class Basher::State
Constants
- TRANSITIONS
Attributes
current[R]
difficulty[RW]
Public Class Methods
all()
click to toggle source
# File lib/basher/state.rb, line 12 def all TRANSITIONS.keys end
new(initial_state = :loading)
click to toggle source
# File lib/basher/state.rb, line 20 def initialize(initial_state = :loading) @current = initial_state end
Public Instance Methods
current_difficulty()
click to toggle source
# File lib/basher/state.rb, line 42 def current_difficulty end
transition_to(state)
click to toggle source
# File lib/basher/state.rb, line 38 def transition_to(state) @current = state if transitions.include?(state) end
transitions()
click to toggle source
# File lib/basher/state.rb, line 34 def transitions TRANSITIONS.fetch(current, []) end