Exception: DataMapper::Property::InvalidValueError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dm-core/property/invalid_value_error.rb

Overview

Exception raised when DataMapper is about to work with invalid property values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, value) ⇒ InvalidValueError

Returns a new instance of InvalidValueError.



8
9
10
11
12
13
14
# File 'lib/dm-core/property/invalid_value_error.rb', line 8

def initialize(property, value)
  msg = format('Invalid value %s for property %s (%s) on model %s', value.inspect, property.name.inspect, property.class.name,
               property.model.name)
  super(msg)
  @property = property
  @value = value
end

Instance Attribute Details

#propertyObject (readonly)

Returns the value of attribute property.



6
7
8
# File 'lib/dm-core/property/invalid_value_error.rb', line 6

def property
  @property
end

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/dm-core/property/invalid_value_error.rb', line 6

def value
  @value
end