Class: Autoproj::QueryBase::Or
- Inherits:
-
Object
- Object
- Autoproj::QueryBase::Or
- Defined in:
- lib/autoproj/query_base.rb
Overview
Match object that combines multiple matches using a logical OR
Instance Method Summary collapse
- #each_subquery(&block) ⇒ Object
-
#initialize(submatches) ⇒ Or
constructor
A new instance of Or.
- #match(pkg) ⇒ Object
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 |