Class: FluentQuery::Queries::Prepared

Inherits:
Abstract
  • Object
show all
Defined in:
lib/fluent-query/queries/prepared.rb

Overview

Prepared query.

Instance Attribute Summary

Attributes inherited from Abstract

#connection

Instance Method Summary collapse

Methods inherited from Abstract

#all, #do, #each, #execute, #find_all, #map, #one, #processor, #single

Constructor Details

#initialize(connection, query) ⇒ Prepared

Returns a new instance of Prepared.



24
25
26
27
# File 'lib/fluent-query/queries/prepared.rb', line 24

def initialize(connection, query)
    super(connection)
    @query = @connection.driver.prepare(query)
end

Instance Method Details

#assoc(specification, *args) ⇒ Object



43
44
45
# File 'lib/fluent-query/queries/prepared.rb', line 43

def assoc(specification, *args)
    self.execute(*args).assoc(specification)
end

#build(*args) ⇒ Object



34
35
36
# File 'lib/fluent-query/queries/prepared.rb', line 34

def build(*args)
    [@query, args]
end