Class: SeqScanner::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/seq_scanner/checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ Checker

Returns a new instance of Checker.



6
7
8
9
# File 'lib/seq_scanner/checker.rb', line 6

def initialize(**opts)
  self.queries = []
  self.explainer = opts.fetch(:explainer) { QueryExplainer }
end

Instance Method Details

#check_query_plan(&block) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/seq_scanner/checker.rb', line 11

def check_query_plan(&block)
  subscribe
  result = block.call
  unsubscribe

  execute_query_plans.each(&:validate)

  result
end