Class: UIC::Application::StateMachine::VisualTransitions
- Inherits:
-
Object
- Object
- UIC::Application::StateMachine::VisualTransitions
- Includes:
- Enumerable
- Defined in:
- lib/ruic/statemachine.rb
Instance Method Summary collapse
- #[](id) ⇒ Object
- #each ⇒ Object
-
#initialize(app_machine, visuals_el) ⇒ VisualTransitions
constructor
A new instance of VisualTransitions.
- #length ⇒ Object (also: #count)
Constructor Details
#initialize(app_machine, visuals_el) ⇒ VisualTransitions
Returns a new instance of VisualTransitions.
96 97 98 99 100 |
# File 'lib/ruic/statemachine.rb', line 96 def initialize(app_machine,visuals_el) @machine = app_machine @wrap = visuals_el @by_el = {} end |
Instance Method Details
#[](id) ⇒ Object
104 105 106 107 108 |
# File 'lib/ruic/statemachine.rb', line 104 def [](id) if el=@wrap.at("xmlns:transition[@ref='#{id}']") @by_el[el] ||= VisualTransition.new(el,@machine) end end |
#each ⇒ Object
101 102 103 |
# File 'lib/ruic/statemachine.rb', line 101 def each @wrap.xpath('xmlns:transition').each{ |el| yield @by_el[el] ||= VisualTransition.new(el,@machine) } end |
#length ⇒ Object Also known as: count
109 110 111 |
# File 'lib/ruic/statemachine.rb', line 109 def length @wrap.xpath('count(xmlns:transition)').to_i end |