Class: Autoproj::QueryBase::And

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

Overview

Match object that combines multiple matches using a logical AND

Instance Method Summary collapse

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