Class: AdManagerApi::FilterStatement
- Inherits:
-
Object
- Object
- AdManagerApi::FilterStatement
- 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
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#offset ⇒ Object
Returns the value of attribute offset.
Instance Method Summary collapse
-
#initialize(query_statement = '', values = [], limit = SUGGESTED_PAGE_LIMIT, offset = 0) ⇒ FilterStatement
constructor
Constructor for a Filter Statement.
- #toStatement ⇒ Object
- #toStatementForAction ⇒ Object
- #toStatementWithoutOffset ⇒ Object
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
#limit ⇒ Object
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 |
#offset ⇒ Object
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
#toStatement ⇒ Object
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 |
#toStatementForAction ⇒ Object
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 |
#toStatementWithoutOffset ⇒ Object
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 |