Exception: Xampl::NotXamplPersistedObject

Inherits:
Exception
  • Object
show all
Defined in:
lib/xamplr/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(thing = nil) ⇒ NotXamplPersistedObject

Returns a new instance of NotXamplPersistedObject.



85
86
87
# File 'lib/xamplr/exceptions.rb', line 85

def initialize(thing=nil)
  @klass = thing.class.name
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



83
84
85
# File 'lib/xamplr/exceptions.rb', line 83

def klass
  @klass
end

Instance Method Details

#messageObject



89
90
91
# File 'lib/xamplr/exceptions.rb', line 89

def message
  "require a XamplPersistedObject, got a #{ klass }"
end