Class: YeSQL::Query::Result

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Common::Adapter
Defined in:
lib/yesql/query/result.rb

Instance Method Summary collapse

Methods included from Common::Adapter

#adapter, #mysql?, #pg?

Constructor Details

#initialize(bind_statement:, file_path:, prepare:, binds: []) ⇒ Result

Returns a new instance of Result.



14
15
16
17
18
19
# File 'lib/yesql/query/result.rb', line 14

def initialize(bind_statement:, file_path:, prepare:, binds: [])
  @binds = binds
  @bind_statement = bind_statement
  @file_path = file_path
  @prepare_option = prepare
end

Instance Method Details

#callObject



21
22
23
24
25
26
# File 'lib/yesql/query/result.rb', line 21

def call
  return view_result if view?
  return rails5_result if ::ActiveRecord::VERSION::MAJOR == 5 && mysql?

  exec_query(bound, file_path, binds, prepare: prepare_option)
end