Class: UIC::Application::StateMachine::VisualAction

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

Direct Known Subclasses

Call, FireEvent, GotoSlide, SetAttribute

Defined Under Namespace

Classes: Call, FireEvent, Generic, GotoSlide, SetAttribute

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(el, owner) ⇒ VisualAction

Returns a new instance of VisualAction.



191
192
193
194
195
# File 'lib/ruic/statemachine.rb', line 191

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

Instance Attribute Details

#elNokogiri::XML::Element (readonly)

Returns the Nokogiri element representing this action in the .uia.

Returns:

  • (Nokogiri::XML::Element)

    the Nokogiri element representing this action in the .uia.



172
173
174
# File 'lib/ruic/statemachine.rb', line 172

def el
  @el
end

#elementUIC::MetaData::AssetBase

Returns the element in a UIC presentation affected by this action.

Returns:



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

xmlattribute(:element, lambda{ |path,action| (action.machine.app / path) }){ |element| element.path }

#machineApplication::StateMachine (readonly)

Returns the state machine triggering this action.

Returns:



178
179
180
# File 'lib/ruic/statemachine.rb', line 178

def machine
  @machine
end

#ownerVisualState, VisualTransition (readonly)

Returns the visual state or transition wrapping this action.

Returns:



175
176
177
# File 'lib/ruic/statemachine.rb', line 175

def owner
  @owner
end

Class Method Details

.create(el, owner) ⇒ Object



180
181
182
183
184
185
186
187
188
189
# File 'lib/ruic/statemachine.rb', line 180

def self.create(el,owner)
	klass = case el.name
		when 'goto-slide'    then GotoSlide
		when 'call'          then Call
		when 'set-attribute' then SetAttribute
		when 'fire-event'    then FireEvent
		else                      Generic
	end
	klass.new(el,owner)
end