Class: Yuriita::Runner
- Inherits:
-
Object
- Object
- Yuriita::Runner
- Defined in:
- lib/yuriita/runner.rb
Instance Method Summary collapse
-
#initialize(relation:, configuration:, **options) ⇒ Runner
constructor
A new instance of Runner.
- #run(query) ⇒ Object
Constructor Details
#initialize(relation:, configuration:, **options) ⇒ Runner
Returns a new instance of Runner.
3 4 5 6 7 8 |
# File 'lib/yuriita/runner.rb', line 3 def initialize(relation:, configuration:, **) @relation = relation @configuration = configuration @executor = .fetch(:executor, Executor) @assembler = .fetch(:assembler, Assembler) end |
Instance Method Details
#run(query) ⇒ Object
10 11 12 13 |
# File 'lib/yuriita/runner.rb', line 10 def run(query) clauses = assembler.new(configuration).build(query) executor.new(clauses).run(relation) end |