Methods

Class/Module Index [+]

Quicksearch

Grape::Exceptions::Validation

Attributes

params[RW]

Public Class Methods

new(args = {}) click to toggle source
# File lib/grape/exceptions/validation.rb, line 8
def initialize(args = {})
  raise "Params are missing:" unless args.key? :params
  @params = args[:params]
  args[:message] = translate_message(args[:message_key]) if args.key? :message_key
  super
end

Public Instance Methods

as_json(*args) click to toggle source

remove all the unnecessary stuff from Grape::Exceptions::Base like status and headers when converting a validation error to json or string

# File lib/grape/exceptions/validation.rb, line 17
def as_json(*args)
  to_s
end
to_s() click to toggle source
# File lib/grape/exceptions/validation.rb, line 21
def to_s
  message
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.