Class: Grape::Validations::Types::InvalidValue

Inherits:
Object
  • Object
show all
Defined in:
lib/grape/validations/types/invalid_value.rb

Overview

Instances of this class may be used as tokens to denote that a parameter value could not be coerced. The given message will be used as a validation error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ InvalidValue

Returns a new instance of InvalidValue.



11
12
13
# File 'lib/grape/validations/types/invalid_value.rb', line 11

def initialize(message = nil)
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



9
10
11
# File 'lib/grape/validations/types/invalid_value.rb', line 9

def message
  @message
end