Exception: StrongerParameters::InvalidParameter

Inherits:
StandardError
  • Object
show all
Defined in:
lib/stronger_parameters/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(invalid_value, key) ⇒ InvalidParameter

Returns a new instance of InvalidParameter.



15
16
17
18
19
# File 'lib/stronger_parameters/errors.rb', line 15

def initialize(invalid_value, key)
  @value = invalid_value.value
  @key = key
  super("Invalid parameter: #{@key} #{invalid_value.message}")
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



13
14
15
# File 'lib/stronger_parameters/errors.rb', line 13

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



13
14
15
# File 'lib/stronger_parameters/errors.rb', line 13

def value
  @value
end