Class: Autoproj::QueryBase::Or

Inherits:
Object
  • Object
show all
Defined in:
lib/autoproj/query_base.rb

Overview

Match object that combines multiple matches using a logical OR

Instance Method Summary collapse

Constructor Details

#initialize(submatches) ⇒ Or

Returns a new instance of Or.



101
102
103
# File 'lib/autoproj/query_base.rb', line 101

def initialize(submatches)
    @submatches = submatches
end

Instance Method Details

#each_subquery(&block) ⇒ Object



105
106
107
# File 'lib/autoproj/query_base.rb', line 105

def each_subquery(&block)
    @submatches.each(&block)
end

#match(pkg) ⇒ Object



109
110
111
# File 'lib/autoproj/query_base.rb', line 109

def match(pkg)
    @submatches.map { |m| m.match(pkg) }.compact.max
end