Class: Golem::Model::State

Inherits:
Object
  • Object
show all
Defined in:
lib/golem/model/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#callbacksObject (readonly)

Returns the value of attribute callbacks.



7
8
9
# File 'lib/golem/model/state.rb', line 7

def callbacks
  @callbacks
end

#commentObject

Returns the value of attribute comment.



10
11
12
# File 'lib/golem/model/state.rb', line 10

def comment
  @comment
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/golem/model/state.rb', line 6

def name
  @name
end

#transitions_on_eventObject (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_sObject



19
20
21
# File 'lib/golem/model/state.rb', line 19

def to_s
  name.to_s
end

#to_symObject



23
24
25
# File 'lib/golem/model/state.rb', line 23

def to_sym
  name.to_sym
end