Class: Roby::Coordination::Models::Child
- Defined in:
- lib/roby/coordination/models/child.rb
Overview
A representation of a task of the execution context’s task
Instance Attribute Summary collapse
-
#parent ⇒ Base, Child
readonly
The child’s parent.
-
#role ⇒ String
readonly
The child’s role, relative to its parent.
Attributes inherited from Task
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(parent, role, model) ⇒ Child
constructor
A new instance of Child.
- #new(execution_context) ⇒ Coordination::Child
- #to_s ⇒ Object
Methods inherited from Task
#can_resolve_child_models?, #find_child, #find_child_model, #find_event, #find_through_method_missing, #has_child?, #has_event?, #has_through_method_missing?, #instanciate, #map_tasks, #rebind, #setup_instanciated_task, #to_coordination_task
Constructor Details
#initialize(parent, role, model) ⇒ Child
Returns a new instance of Child.
13 14 15 16 17 |
# File 'lib/roby/coordination/models/child.rb', line 13 def initialize(parent, role, model) super(model) @parent, @role = parent, role end |
Instance Attribute Details
#parent ⇒ Base, Child (readonly)
Returns the child’s parent.
9 10 11 |
# File 'lib/roby/coordination/models/child.rb', line 9 def parent @parent end |
#role ⇒ String (readonly)
Returns the child’s role, relative to its parent.
11 12 13 |
# File 'lib/roby/coordination/models/child.rb', line 11 def role @role end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/roby/coordination/models/child.rb', line 19 def ==(other) other.kind_of?(Child) && other.parent == parent && other.role == role && other.model == model end |
#new(execution_context) ⇒ Coordination::Child
27 28 29 |
# File 'lib/roby/coordination/models/child.rb', line 27 def new(execution_context) Coordination::Child.new(execution_context, self) end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/roby/coordination/models/child.rb', line 31 def to_s "#{parent}.#{role}_child[#{model}]" end |