Class: DfpApi::PQLQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/dfp_api/pql_statement_utils.rb

Overview

Query class used by StatementBuilder.

Instance Method Summary collapse

Constructor Details

#initialize(query = nil) ⇒ PQLQuery

Create a new query.



30
31
32
# File 'lib/dfp_api/pql_statement_utils.rb', line 30

def initialize(query = nil)
  @query = (query.nil?) ? nil : query.dup()
end

Instance Method Details

#<<(clause) ⇒ Object

Concatenate a new clause onto the current query.



35
36
37
# File 'lib/dfp_api/pql_statement_utils.rb', line 35

def <<(clause)
  @query = (@query.nil?) ? clause : @query << ' ' << clause
end

#to_s ⇒ Object

Return the query string for a PQLQuery



40
41
42
# File 'lib/dfp_api/pql_statement_utils.rb', line 40

def to_s()
  @query.dup()
end