Module: BingAdsApi::Helpers::ScopeHelper

Includes:
SOAPHasheable
Defined in:
lib/bing-ads-api/data/reporting/helpers/scope_helper.rb

Overview

Public : Utility module for scope attribute in ReportRequest derived classes

Author

[email protected]

Constant Summary collapse

FILTERS_CRITERIA =

Valid filters values for each known criteria

BingAdsApi::Config.instance.
reporting_constants['filters']

Instance Method Summary collapse

Methods included from SOAPHasheable

#date_to_hash, #get_attribute_key, #normalize_hash_keys, #object_to_hash, #to_hash

Instance Method Details

#scope_to_hash(keys_case = :undescore) ⇒ Object

Public : Returns the filter attribute as a Hash to SOAP requests

Author

[email protected]

filter - Hash with the filter values

Returns

Hash



46
47
# File 'lib/bing-ads-api/data/reporting/helpers/scope_helper.rb', line 46

def scope_to_hash(keys_case=:undescore)
end

#valid_scope(valid_scopes, scope) ⇒ Object

Internal : Validates the filter attribute at the ReporRequest initialization At the first invalid filter criteria or value detected this method raises Exception. If all filter criteria and values are ok, this method returns true Valid filter criteria are validated against FILTERS_CRITERIA constant Valid filter values are validated against FILTERS constant

Author

[email protected]

Parameters

valid_filters - Hash with the set of valid filter values filter - Hash with the filter criteria and values

Returns

true if filter is valid

Raises

Exception at the first invalid filter criteria o value



35
36
# File 'lib/bing-ads-api/data/reporting/helpers/scope_helper.rb', line 35

def valid_scope(valid_scopes, scope)
end