Class: Golem::Model::State
- Inherits:
-
Object
- Object
- Golem::Model::State
- Defined in:
- lib/golem/model/state.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#transitions_on_event ⇒ Object
readonly
Returns the value of attribute transitions_on_event.
Instance Method Summary collapse
-
#initialize(name) ⇒ State
constructor
A new instance of State.
- #to_s ⇒ Object
- #to_sym ⇒ Object
Constructor Details
#initialize(name) ⇒ State
Returns a new instance of State.
10 11 12 13 14 15 |
# File 'lib/golem/model/state.rb', line 10 def initialize(name) name = name.to_sym unless name.is_a?(Symbol) @name = name @transitions_on_event = Golem::Util::ElementCollection.new @callbacks = {} end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
7 8 9 |
# File 'lib/golem/model/state.rb', line 7 def callbacks @callbacks end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/golem/model/state.rb', line 6 def name @name end |
#transitions_on_event ⇒ Object (readonly)
Returns the value of attribute transitions_on_event.
8 9 10 |
# File 'lib/golem/model/state.rb', line 8 def transitions_on_event @transitions_on_event end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/golem/model/state.rb', line 17 def to_s name.to_s end |
#to_sym ⇒ Object
21 22 23 |
# File 'lib/golem/model/state.rb', line 21 def to_sym name.to_sym end |