Exception: ActiveValidation::Errors::UnsupportedMethodError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/active_validation/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, allowed_methods:) ⇒ UnsupportedMethodError



17
18
19
20
21
# File 'lib/active_validation/errors.rb', line 17

def initialize(value:, allowed_methods:)
  super
  @value = value
  @allowed_methods = allowed_methods
end

Instance Attribute Details

#allowed_methodsObject (readonly)

Returns the value of attribute allowed_methods.



16
17
18
# File 'lib/active_validation/errors.rb', line 16

def allowed_methods
  @allowed_methods
end

#valueObject (readonly)

Returns the value of attribute value.



16
17
18
# File 'lib/active_validation/errors.rb', line 16

def value
  @value
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/active_validation/errors.rb', line 23

def to_s
  "You provided #{value.inspect} while supported are only #{allowed_methods.inspect}"
end