Class: Roby::Coordination::Models::Variable
- Includes:
- Tools::Calculus::Build
- Defined in:
- lib/roby/coordination/models/variable.rb
Overview
Placeholder, in the execution contexts, for variables. It is used for instance to hold the arguments to the state machine during modelling, replaced by their values during instanciation
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #can_merge? ⇒ Boolean
- #evaluate(variables) ⇒ Object
- #evaluate_delayed_argument(task) ⇒ Object
- #strong? ⇒ Boolean
- #to_coordination_task(task_model = Roby::Task) ⇒ Object
- #to_s ⇒ Object
Methods included from Tools::Calculus::Build
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
9 10 11 |
# File 'lib/roby/coordination/models/variable.rb', line 9 def name @name end |
Instance Method Details
#can_merge? ⇒ Boolean
31 32 33 |
# File 'lib/roby/coordination/models/variable.rb', line 31 def can_merge?(*) false end |
#evaluate(variables) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/roby/coordination/models/variable.rb', line 11 def evaluate(variables) if variables.has_key?(name) variables[name] else raise ArgumentError, "expected a value for #{arg}, got none" end end |
#evaluate_delayed_argument(task) ⇒ Object
35 36 37 |
# File 'lib/roby/coordination/models/variable.rb', line 35 def evaluate_delayed_argument(task) throw :no_value end |
#strong? ⇒ Boolean
27 28 29 |
# File 'lib/roby/coordination/models/variable.rb', line 27 def strong? true end |
#to_coordination_task(task_model = Roby::Task) ⇒ Object
23 24 25 |
# File 'lib/roby/coordination/models/variable.rb', line 23 def to_coordination_task(task_model = Roby::Task) TaskFromVariable.new(name, task_model) end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/roby/coordination/models/variable.rb', line 19 def to_s "var:#{name}" end |