Exception: ActiveValidation::Errors::UnsupportedMethodError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- ActiveValidation::Errors::UnsupportedMethodError
- Defined in:
- lib/active_validation/errors.rb
Instance Attribute Summary collapse
-
#allowed_methods ⇒ Object
readonly
Returns the value of attribute allowed_methods.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value:, allowed_methods:) ⇒ UnsupportedMethodError
constructor
A new instance of UnsupportedMethodError.
- #to_s ⇒ Object
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_methods ⇒ Object (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 |
#value ⇒ Object (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_s ⇒ Object
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 |