Exception: ActiveTriples::UndefinedPropertyError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/active_triples/undefined_property_error.rb

Overview

An error class to be raised when attempting to reflect on an undefined property.

Examples:

begin 
  my_source.set_value(:fake_property, 'blah')
rescue ActiveTriples::UndefinedPropertyError => e
  e.property => 'fake_property'
  e.klass => 'MySourceClass'
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, klass) ⇒ UndefinedPropertyError

Returns a new instance of UndefinedPropertyError.



18
19
20
21
# File 'lib/active_triples/undefined_property_error.rb', line 18

def initialize(property, klass)
  @property = property
  @klass = klass
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



16
17
18
# File 'lib/active_triples/undefined_property_error.rb', line 16

def klass
  @klass
end

#propertyObject (readonly)

Returns the value of attribute property.



16
17
18
# File 'lib/active_triples/undefined_property_error.rb', line 16

def property
  @property
end

Instance Method Details

#messageObject



23
24
25
# File 'lib/active_triples/undefined_property_error.rb', line 23

def message
  "The property `#{@property}` is not defined on class '#{@klass}'"
end