Exception: SmartProperties::InvalidValueError
- Inherits:
-
AssignmentError
- Object
- ArgumentError
- Error
- AssignmentError
- SmartProperties::InvalidValueError
- Defined in:
- lib/smart_properties/errors.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from AssignmentError
Instance Method Summary collapse
-
#initialize(sender, property, value) ⇒ InvalidValueError
constructor
A new instance of InvalidValueError.
- #to_hash ⇒ Object
Constructor Details
#initialize(sender, property, value) ⇒ InvalidValueError
Returns a new instance of InvalidValueError.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/smart_properties/errors.rb', line 65 def initialize(sender, property, value) @value = value super( sender, property, "%s does not accept %s as value for the property %s. Only accepts: %s" % [ sender.class.name, value.inspect, property.name, (sender, property) ] ) end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
63 64 65 |
# File 'lib/smart_properties/errors.rb', line 63 def value @value end |
Instance Method Details
#to_hash ⇒ Object
80 81 82 |
# File 'lib/smart_properties/errors.rb', line 80 def to_hash Hash[property.name, "does not accept %s as value" % value.inspect] end |