Method: Roby::Queries::TaskMatcher#|

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

#|(other) ⇒ Object

Computes the union of two predicates

The returned task matcher will yield tasks that are matched by any of its the elements.

Roby does only supports computing the OR of task matchers (cannot combine different operators)



609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/roby/queries/task_matcher.rb', line 609

def |(other)
    result = OrMatcher::Tasks.new
    result << self
    case other
    when OrMatcher::Tasks
        result.merge(other)
    when TaskMatcher
        result << other
    else
        raise ArgumentError,
              "cannot compute the union of a TaskMatcher with #{other}"
    end
end