class StatePattern::State

Attributes

previous_state[R]
stateful[R]

Public Class Methods

new(stateful, previous_state) click to toggle source
# File lib/state_pattern/state.rb, line 4
def initialize(stateful, previous_state)
  @stateful = stateful
  @previous_state = previous_state
  enter
end
state_methods() click to toggle source
# File lib/state_pattern/state.rb, line 10
def self.state_methods
  public_instance_methods - State.public_instance_methods
end

Public Instance Methods

enter() click to toggle source
# File lib/state_pattern/state.rb, line 18
def enter
end
exit() click to toggle source
# File lib/state_pattern/state.rb, line 21
def exit
end
transition_to(state_class) click to toggle source
# File lib/state_pattern/state.rb, line 14
def transition_to(state_class)
  @stateful.transition_to(state_class)
end