Class: Query::Combiner
Class Method Summary collapse
Instance Method Summary collapse
- #combine ⇒ Object
-
#initialize(*sources) ⇒ Combiner
constructor
A new instance of Combiner.
Constructor Details
#initialize(*sources) ⇒ Combiner
Returns a new instance of Combiner.
5 6 7 |
# File 'lib/query/combiner.rb', line 5 def initialize(*sources) self.sources = sources end |
Class Method Details
.combine ⇒ Object
9 10 11 |
# File 'lib/query/combiner.rb', line 9 def self.combine(...) new(...).combine end |
Instance Method Details
#combine ⇒ Object
13 14 15 16 17 18 |
# File 'lib/query/combiner.rb', line 13 def combine sources .map { |source| Query.evaluate(source) } .reduce { |acc, element| combine_parsed(acc, element) } .then { |parsed| Query.decompile(parsed) } end |