Class: Yuriita::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/yuriita/runner.rb

Instance Method Summary collapse

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:, **options)
  @relation = relation
  @configuration = configuration
  @executor = options.fetch(:executor, Executor)
  @assembler = options.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