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.



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

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.



124
125
126
# File 'lib/restspec/schema/checker.rb', line 124

def attribute
  @attribute
end

#objectObject

Returns the value of attribute object.



124
125
126
# File 'lib/restspec/schema/checker.rb', line 124

def object
  @object
end

#valueObject

Returns the value of attribute value.



124
125
126
# File 'lib/restspec/schema/checker.rb', line 124

def value
  @value
end

Instance Method Details

#to_sObject



132
133
134
# File 'lib/restspec/schema/checker.rb', line 132

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