Exception: StateFu::TransitionNotFound

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

Constant Summary

DEFAULT_MESSAGE =
"Transition could not be determined"

Instance Attribute Summary (collapse)

Attributes inherited from Error

#binding, #options

Instance Method Summary (collapse)

Constructor Details

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

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

- (Object) valid_destinations (readonly)

Returns the value of attribute valid_destinations



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

def valid_destinations
  @valid_destinations
end

- (Object) valid_transitions (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

- (Object) inspect



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

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