Exception: StateFu::TransitionNotFound

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

Constant Summary collapse

DEFAULT_MESSAGE =
"Transition could not be determined"

Instance Attribute Summary collapse

Attributes inherited from Error

#binding, #options

Instance Method Summary collapse

Constructor Details

#initialize(binding, valid_transitions, message = DEFAULT_MESSAGE, options = {}) ⇒ TransitionNotFound

Returns a new instance of TransitionNotFound.



22
23
24
25
26
# File 'lib/support/exceptions.rb', line 22

def initialize(binding, valid_transitions, message=DEFAULT_MESSAGE, options={})
  @valid_transitions  = valid_transitions
  @valid_destinations = valid_transitions.map(&:destination)
  super(binding, message, options)
end

Instance Attribute Details

#valid_destinationsObject (readonly)

Returns the value of attribute valid_destinations.



19
20
21
# File 'lib/support/exceptions.rb', line 19

def valid_destinations
  @valid_destinations
end

#valid_transitionsObject (readonly)

Returns the value of attribute valid_transitions.



18
19
20
# File 'lib/support/exceptions.rb', line 18

def valid_transitions
  @valid_transitions
end

Instance Method Details

#inspectObject



28
29
30
# File 'lib/support/exceptions.rb', line 28

def inspect
  "<#{self.class.to_s} #{message} available=[#{valid_destinations.inspect}]>"
end