Class: UIC::Application::StateMachine::VisualState

Inherits:
Object
  • Object
show all
Includes:
ElementBacked
Defined in:
lib/ruic/statemachine.rb

Instance Attribute Summary collapse

Attributes included from ElementBacked

#owner

Instance Method Summary collapse

Constructor Details

#initialize(el, machine) ⇒ VisualState

Returns a new instance of VisualState.



128
129
130
131
# File 'lib/ruic/statemachine.rb', line 128

def initialize(el,machine)
	@el = el
	@machine = machine
end

Instance Attribute Details

#elNokogiri::XML::Element (readonly)

Returns the Nokogiri element in the .uia representing this visual state.

Returns:

  • (Nokogiri::XML::Element)

    the Nokogiri element in the .uia representing this visual state.



123
124
125
# File 'lib/ruic/statemachine.rb', line 123

def el
  @el
end

#machineApplication::StateMachine (readonly)

Returns the state machine containing the referenced state.

Returns:



126
127
128
# File 'lib/ruic/statemachine.rb', line 126

def machine
  @machine
end

#refString

Returns the id of the state in the state machine whose enter/exit will trigger the attached visual actions.

Returns:

  • (String)

    the id of the state in the state machine whose enter/exit will trigger the attached visual actions.



120
# File 'lib/ruic/statemachine.rb', line 120

xmlattribute :ref

Instance Method Details

#enter_actionsObject



133
134
135
# File 'lib/ruic/statemachine.rb', line 133

def enter_actions
	@el.xpath('xmlns:enter/*').to_a.map{ |el| VisualAction.create(el,self) }
end

#exit_actionsObject



137
138
139
# File 'lib/ruic/statemachine.rb', line 137

def exit_actions
	@el.xpath('xmlns:exit/*').to_a.map{ |el| VisualAction.create(el,self) }
end