Exception: StateFu::TransitionError

Inherits:
Error show all
Defined in:
lib/support/exceptions.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#binding, #options

Instance Method Summary collapse

Constructor Details

#initialize(transition, message = nil, options = {}) ⇒ TransitionError

Returns a new instance of TransitionError.



38
39
40
41
42
# File 'lib/support/exceptions.rb', line 38

def initialize transition, message=nil, options={}
  # raise caller.inspect unless transition.is_a?(Transition)
  @transition = transition 
  super transition.binding, message, options
end

Instance Attribute Details

#transitionObject (readonly)

TODO default message



36
37
38
# File 'lib/support/exceptions.rb', line 36

def transition
  @transition
end

Instance Method Details

#inspectObject



54
55
56
57
58
59
# File 'lib/support/exceptions.rb', line 54

def inspect
  origin_name = origin && origin.name
  target_name = target && target.name
  event_name  = event  && event.name  
  "<#{self.class.to_s} #{message} #{origin_name.inspect}=[#{event_name.inspect}]=>#{target_name.inspect}>"
end