Exception: Apia::InvalidPolymorphValueError
- Inherits:
-
RuntimeError
- Object
- StandardError
- StandardError
- RuntimeError
- Apia::InvalidPolymorphValueError
- Defined in:
- lib/apia/errors/invalid_polymorph_value_error.rb
Instance Attribute Summary collapse
-
#given_value ⇒ Object
readonly
Returns the value of attribute given_value.
-
#polymorph ⇒ Object
readonly
Returns the value of attribute polymorph.
Instance Method Summary collapse
-
#initialize(polymorph, given_value) ⇒ InvalidPolymorphValueError
constructor
A new instance of InvalidPolymorphValueError.
- #to_s ⇒ Object
Methods inherited from RuntimeError
Constructor Details
#initialize(polymorph, given_value) ⇒ InvalidPolymorphValueError
Returns a new instance of InvalidPolymorphValueError.
11 12 13 14 |
# File 'lib/apia/errors/invalid_polymorph_value_error.rb', line 11 def initialize(polymorph, given_value) @polymorph = polymorph @given_value = given_value end |
Instance Attribute Details
#given_value ⇒ Object (readonly)
Returns the value of attribute given_value.
9 10 11 |
# File 'lib/apia/errors/invalid_polymorph_value_error.rb', line 9 def given_value @given_value end |
#polymorph ⇒ Object (readonly)
Returns the value of attribute polymorph.
8 9 10 |
# File 'lib/apia/errors/invalid_polymorph_value_error.rb', line 8 def polymorph @polymorph end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/apia/errors/invalid_polymorph_value_error.rb', line 16 def to_s "Invalid value for `#{polymorph.definition.id}` (got: #{@given_value.inspect})" end |