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.
1160 1161 1162 1163 |
# File 'lib/roby/plan.rb', line 1160 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
1158 1159 1160 |
# File 'lib/roby/plan.rb', line 1158 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
1156 1157 1158 |
# File 'lib/roby/plan.rb', line 1156 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
1169 1170 1171 |
# File 'lib/roby/plan.rb', line 1169 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
1184 1185 1186 |
# File 'lib/roby/plan.rb', line 1184 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
1177 1178 1179 1180 1181 |
# File 'lib/roby/plan.rb', line 1177 def each(plan, &block) query.plan = plan query.reset query.each(&block) end |