Class: Roby::Coordination::Event
- Defined in:
- lib/roby/coordination/event.rb
Overview
Representation of the context’s root task
Instance Attribute Summary collapse
-
#execution_context ⇒ Base
readonly
The underlying execution context.
- #model ⇒ Coordination::Event readonly
-
#task ⇒ Coordination::Task
readonly
The task this event is part of.
Instance Method Summary collapse
-
#initialize(execution_context, model) ⇒ Event
constructor
A new instance of Event.
- #resolve ⇒ Object
- #symbol ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(execution_context, model) ⇒ Event
Returns a new instance of Event.
15 16 17 18 19 |
# File 'lib/roby/coordination/event.rb', line 15 def initialize(execution_context, model) @execution_context = execution_context @model = model @task = execution_context.instance_for(model.task) end |
Instance Attribute Details
#execution_context ⇒ Base (readonly)
Returns the underlying execution context.
8 9 10 |
# File 'lib/roby/coordination/event.rb', line 8 def execution_context @execution_context end |
#model ⇒ Coordination::Event (readonly)
13 14 15 |
# File 'lib/roby/coordination/event.rb', line 13 def model @model end |
#task ⇒ Coordination::Task (readonly)
Returns the task this event is part of.
11 12 13 |
# File 'lib/roby/coordination/event.rb', line 11 def task @task end |
Instance Method Details
#resolve ⇒ Object
25 26 27 |
# File 'lib/roby/coordination/event.rb', line 25 def resolve task.resolve.event(model.symbol) end |
#symbol ⇒ Object
21 22 23 |
# File 'lib/roby/coordination/event.rb', line 21 def symbol model.symbol end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/roby/coordination/event.rb', line 29 def to_s "#{task}.#{symbol}_event" end |