Exception: Restspec::Schema::Checker::InvalidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/restspec/schema/checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, attribute) ⇒ InvalidationError

Returns a new instance of InvalidationError


121
122
123
124
125
# File 'lib/restspec/schema/checker.rb', line 121

def initialize(object, attribute)
  self.object = object
  self.attribute = attribute
  self.value = object.fetch(attribute.name)
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute


119
120
121
# File 'lib/restspec/schema/checker.rb', line 119

def attribute
  @attribute
end

#objectObject

Returns the value of attribute object


119
120
121
# File 'lib/restspec/schema/checker.rb', line 119

def object
  @object
end

#valueObject

Returns the value of attribute value


119
120
121
# File 'lib/restspec/schema/checker.rb', line 119

def value
  @value
end

Instance Method Details

#to_sObject


127
128
129
# File 'lib/restspec/schema/checker.rb', line 127

def to_s
  "The property #{attribute.name} of #{object} was not valid according to the type #{attribute.type}"
end