Class: Autoproj::QueryBase::And
- Inherits:
-
Object
- Object
- Autoproj::QueryBase::And
- Defined in:
- lib/autoproj/query_base.rb
Overview
Match object that combines multiple matches using a logical AND
Instance Method Summary collapse
- #each_subquery(&block) ⇒ Object
-
#initialize(submatches) ⇒ And
constructor
A new instance of And.
- #match(pkg) ⇒ Object
Constructor Details
#initialize(submatches) ⇒ And
Returns a new instance of And.
116 117 118 |
# File 'lib/autoproj/query_base.rb', line 116 def initialize(submatches) @submatches = submatches end |
Instance Method Details
#each_subquery(&block) ⇒ Object
120 121 122 |
# File 'lib/autoproj/query_base.rb', line 120 def each_subquery(&block) @submatches.each(&block) end |
#match(pkg) ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'lib/autoproj/query_base.rb', line 124 def match(pkg) matches = @submatches.map do |m| return unless (p = m.match(pkg)) p end matches.min end |