Class: Roby::Plan::Trigger Private
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A trigger created by #add_trigger
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
private
The block that will be called if #query matches.
-
#query ⇒ Object
readonly
private
The query that is being watched.
Instance Method Summary collapse
-
#===(task) ⇒ Boolean
private
Whether self would be triggering on task.
-
#call(task) ⇒ Object
private
Call the trigger’s observer for the given task.
-
#each(plan) {|task| ... } ⇒ Object
private
Lists the tasks that match the query.
-
#initialize(query, block) ⇒ Trigger
constructor
private
A new instance of Trigger.
Constructor Details
#initialize(query, block) ⇒ Trigger
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Trigger.
1156 1157 1158 1159 |
# File 'lib/roby/plan.rb', line 1156 def initialize(query, block) @query = query.query @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The block that will be called if #query matches
1154 1155 1156 |
# File 'lib/roby/plan.rb', line 1154 def block @block end |
#query ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The query that is being watched
1152 1153 1154 |
# File 'lib/roby/plan.rb', line 1152 def query @query end |
Instance Method Details
#===(task) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Whether self would be triggering on task
1165 1166 1167 |
# File 'lib/roby/plan.rb', line 1165 def ===(task) query === task end |
#call(task) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Call the trigger’s observer for the given task
1180 1181 1182 |
# File 'lib/roby/plan.rb', line 1180 def call(task) block.call(task) end |
#each(plan) {|task| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Lists the tasks that match the query
1173 1174 1175 1176 1177 |
# File 'lib/roby/plan.rb', line 1173 def each(plan, &block) query.plan = plan query.reset query.each(&block) end |