Exception: Lore::Exceptions::Invalid_Field
- Defined in:
- lib/lore/exceptions/invalid_field.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#invalid_params ⇒ Object
(also: #fields)
readonly
Returns the value of attribute invalid_params.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(invalid_params) ⇒ Invalid_Field
constructor
A new instance of Invalid_Field.
- #inspect ⇒ Object
- #serialize ⇒ Object
Constructor Details
#initialize(invalid_params) ⇒ Invalid_Field
Returns a new instance of Invalid_Field.
9 10 11 12 |
# File 'lib/lore/exceptions/invalid_field.rb', line 9 def initialize(invalid_params) @invalid_params = invalid_params @reason = :invalid end |
Instance Attribute Details
#invalid_params ⇒ Object (readonly) Also known as: fields
Returns the value of attribute invalid_params.
7 8 9 |
# File 'lib/lore/exceptions/invalid_field.rb', line 7 def invalid_params @invalid_params end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
7 8 9 |
# File 'lib/lore/exceptions/invalid_field.rb', line 7 def reason @reason end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/lore/exceptions/invalid_field.rb', line 22 def inspect serialize.inspect end |
#serialize ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/lore/exceptions/invalid_field.rb', line 15 def serialize result = {} @invalid_params.each_pair { |field, type| result[field] = type } result end |