Exception: Restspec::Schema::Checker::DifferentTypeError
- Inherits:
-
StandardError
- Object
- StandardError
- Restspec::Schema::Checker::DifferentTypeError
- Defined in:
- lib/restspec/schema/checker.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#object ⇒ Object
Returns the value of attribute object.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(object, attribute) ⇒ DifferentTypeError
constructor
A new instance of DifferentTypeError.
- #to_s ⇒ Object
Constructor Details
#initialize(object, attribute) ⇒ DifferentTypeError
Returns a new instance of DifferentTypeError.
49 50 51 52 53 |
# File 'lib/restspec/schema/checker.rb', line 49 def initialize(object, attribute) self.object = object self.attribute = attribute self.value = object.fetch(attribute.name) end |
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
47 48 49 |
# File 'lib/restspec/schema/checker.rb', line 47 def attribute @attribute end |
#object ⇒ Object
Returns the value of attribute object.
47 48 49 |
# File 'lib/restspec/schema/checker.rb', line 47 def object @object end |
#value ⇒ Object
Returns the value of attribute value.
47 48 49 |
# File 'lib/restspec/schema/checker.rb', line 47 def value @value end |
Instance Method Details
#to_s ⇒ Object
55 56 57 |
# File 'lib/restspec/schema/checker.rb', line 55 def to_s "The property #{attribute.name} of #{object} should be of type #{attribute.type} but it was of type #{value.class}" end |