class Grape::Exceptions::Validation
Attributes
param[RW]
Public Class Methods
new(args = {})
click to toggle source
Calls superclass method
Grape::Exceptions::Base::new
# File lib/grape/exceptions/validation.rb, line 8 def initialize(args = {}) raise "Param is missing:" unless args.key? :param @param = args[:param] 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