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
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 19 20 21 |
# File 'lib/query/combiner.rb', line 13 def combine sources.map do |source| Query.evaluate(source) end.reduce do |acc, element| combine_parsed(acc, element) end.then do |parsed| Query.decompile(parsed) end end |