Class: AdwordsApi::QueryBuilder
  
  
  
  
  
    - Inherits:
- 
      Object
      
        
          - Object
- AdwordsApi::QueryBuilder
 show all
    - Defined in:
- lib/adwords_api/query_utils/query_builder.rb
 
  
    
      Instance Method Summary
      collapse
    
    
  
  Constructor Details
  
    
  
  
    
Returns a new instance of QueryBuilder.
   
 
  
  
    | 
24
25
26
27 | # File 'lib/adwords_api/query_utils/query_builder.rb', line 24
def initialize(api)
  @api = api
  @where = []
end | 
 
  
 
  
    Instance Method Details
    
      
  
  
    #build_where  ⇒ Object 
  
  
  
  
    | 
35
36
37
38
39 | # File 'lib/adwords_api/query_utils/query_builder.rb', line 35
def build_where()
  return '' if @where.empty?
  wheres = @where.map {|w| w.awql}
  return sprintf(' WHERE %s', wheres.join(' AND '))
end | 
 
    
      
  
  
    #where(field)  ⇒ Object 
  
  
  
  
    | 
29
30
31
32
33 | # File 'lib/adwords_api/query_utils/query_builder.rb', line 29
def where(field)
  clause = WhereBuilder.new(field)
  @where << clause
  return clause
end |