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.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#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.
12 13 14 15 16 17 |
# File 'lib/golem/model/state.rb', line 12 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 |
#comment ⇒ Object
Returns the value of attribute comment.
10 11 12 |
# File 'lib/golem/model/state.rb', line 10 def comment @comment 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
19 20 21 |
# File 'lib/golem/model/state.rb', line 19 def to_s name.to_s end |
#to_sym ⇒ Object
23 24 25 |
# File 'lib/golem/model/state.rb', line 23 def to_sym name.to_sym end |