Class: AdManagerApi::FilterStatement

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_manager_api/ad_manager_api_statement.rb

Overview

A statement object for PQL and get*ByStatement queries. Deprecated. Use StatementBuilder instead.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query_statement = '', values = [], limit = SUGGESTED_PAGE_LIMIT, offset = 0) ⇒ FilterStatement

Constructor for a Filter Statement.



29
30
31
32
33
34
35
# File 'lib/ad_manager_api/ad_manager_api_statement.rb', line 29

def initialize(query_statement='', values=[], limit=SUGGESTED_PAGE_LIMIT,
               offset=0)
  @query_statement = query_statement.dup()
  @values = values
  @limit = limit
  @offset = offset
end

Instance Attribute Details

#limitObject

Returns the value of attribute limit.



37
38
39
# File 'lib/ad_manager_api/ad_manager_api_statement.rb', line 37

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



38
39
40
# File 'lib/ad_manager_api/ad_manager_api_statement.rb', line 38

def offset
  @offset
end

Instance Method Details

#toStatementObject



40
41
42
43
44
# File 'lib/ad_manager_api/ad_manager_api_statement.rb', line 40

def toStatement()
  register_filter_statement_util()
  statement = @query_statement + ' LIMIT %d OFFSET %d' % [@limit, @offset]
  return {:query => statement, :values => @values}
end

#toStatementForActionObject



46
47
48
49
# File 'lib/ad_manager_api/ad_manager_api_statement.rb', line 46

def toStatementForAction()
  register_filter_statement_util()
  return {:query => @query_statement.dup(), :values => @values}
end

#toStatementWithoutOffsetObject



51
52
53
54
55
# File 'lib/ad_manager_api/ad_manager_api_statement.rb', line 51

def toStatementWithoutOffset()
  register_filter_statement_util()
  statement = @query_statement + ' LIMIT %d' % [@limit]
  return {:query => statement, :values => @values}
end