Sha256: 2325ea0feb863a670a065e5eff25799c46f1cbfa6dc73e62b54ecc49b391fec0
Contents?: true
Size: 448 Bytes
Versions: 3
Compression:
Stored size: 448 Bytes
Contents
module StatePattern class State attr_reader :stateful, :previous_state def initialize(stateful, previous_state) @stateful = stateful @previous_state = previous_state enter end def self.state_methods public_instance_methods - State.public_instance_methods end def transition_to(state_class) @stateful.transition_to(state_class) end def enter end def exit end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
state_pattern-2.0.2 | ./lib/state_pattern/state.rb |
state_pattern-2.0.1 | ./lib/state_pattern/state.rb |
state_pattern-2.0.0 | ./lib/state_pattern/state.rb |