Class: Storing::Postgres::AbstractQuery

Inherits:
AbstractQuery show all
Defined in:
lib/storing/postgres/abstract_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query_object = nil) ⇒ AbstractQuery

Returns a new instance of AbstractQuery.



8
9
10
# File 'lib/storing/postgres/abstract_query.rb', line 8

def initialize query_object=nil
	@query_object = query_object
end

Instance Attribute Details

#query_objectObject (readonly)

Returns the value of attribute query_object.



6
7
8
# File 'lib/storing/postgres/abstract_query.rb', line 6

def query_object
  @query_object
end

Instance Method Details

#dataset(ds) ⇒ Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/storing/postgres/abstract_query.rb', line 21

def dataset ds
	raise NotImplementedError
end

#query(database) ⇒ Object



12
13
14
# File 'lib/storing/postgres/abstract_query.rb', line 12

def query database
	query_chain(database).select_sql
end

#query_chain(database) ⇒ Object



16
17
18
19
# File 'lib/storing/postgres/abstract_query.rb', line 16

def query_chain database
	ds = call_query_chain(database)
	dataset(ds)
end