Method: Roby::Queries::TaskMatcher#===

Defined in:
lib/roby/queries/task_matcher.rb

#===(task) ⇒ Object

True if task matches all the criteria defined on this object.



424
425
426
427
428
429
430
431
432
433
# File 'lib/roby/queries/task_matcher.rb', line 424

def ===(task) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
    return unless task.kind_of?(Roby::Task)
    return unless task.arguments.slice(*arguments.keys) == arguments
    return unless super
    return unless (plan = task.plan)
    return unless @plan_predicates.all? { |pred| plan.send(pred, task) }
    return if @neg_plan_predicates.any? { |pred| plan.send(pred, task) }

    true
end