Class: Roby::TaskStructure::ConflictError
- Defined in:
- lib/roby/task_structure/conflicts.rb
Overview
Class holding conflict error information
Note that it is not an exception as a failed conflict is usually handled by calling #failed_to_start! on the newly started task
Instance Attribute Summary collapse
-
#running_tasks ⇒ Object
readonly
Returns the value of attribute running_tasks.
-
#starting_task ⇒ Object
readonly
Returns the value of attribute starting_task.
Instance Method Summary collapse
-
#initialize(starting_task, running_tasks) ⇒ ConflictError
constructor
A new instance of ConflictError.
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(starting_task, running_tasks) ⇒ ConflictError
Returns a new instance of ConflictError.
83 84 85 |
# File 'lib/roby/task_structure/conflicts.rb', line 83 def initialize(starting_task, running_tasks) @starting_task, @running_tasks = starting_task, running_tasks end |
Instance Attribute Details
#running_tasks ⇒ Object (readonly)
Returns the value of attribute running_tasks.
81 82 83 |
# File 'lib/roby/task_structure/conflicts.rb', line 81 def running_tasks @running_tasks end |
#starting_task ⇒ Object (readonly)
Returns the value of attribute starting_task.
81 82 83 |
# File 'lib/roby/task_structure/conflicts.rb', line 81 def starting_task @starting_task end |
Instance Method Details
#pretty_print(pp) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/roby/task_structure/conflicts.rb', line 87 def pretty_print(pp) pp.text "failed to start " starting_task.pretty_print(pp) pp.text "because it conflicts with #{running_tasks.size} running tasks" pp.nest(2) do runnning_tasks.each do |t| pp.breakable t.pretty_print(pp) end end end |