Class: BingAdsRubySdk::Services::Base
- Inherits:
-
Object
- Object
- BingAdsRubySdk::Services::Base
- Defined in:
- lib/bing_ads_ruby_sdk/services/base.rb
Direct Known Subclasses
AdInsight, Bulk, CampaignManagement, CustomerBilling, CustomerManagement, Reporting
Class Method Summary collapse
Instance Method Summary collapse
- #call(operation_name, message = {}) ⇒ Object
- #call_wrapper(action, message, *response_nesting) ⇒ Object
-
#initialize(soap_client) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(soap_client) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 11 def initialize(soap_client) @soap_client = soap_client end |
Class Method Details
.service ⇒ Object
34 35 36 |
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 34 def self.service raise "implement me" end |
Instance Method Details
#call(operation_name, message = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 15 def call(operation_name, = {}) camelized_name = BingAdsRubySdk::StringUtils.camelize(operation_name.to_s) response = soap_client.call( camelized_name, preprocess(, camelized_name) ) processed_response = postprocess(response) BingAdsRubySdk::Errors::ErrorHandler.new(processed_response).call processed_response rescue BingAdsRubySdk::Errors::GeneralError => e BingAdsRubySdk.log(:warn) { processed_response } raise e end |
#call_wrapper(action, message, *response_nesting) ⇒ Object
29 30 31 32 |
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 29 def call_wrapper(action, , *response_nesting) response = call(action, ) wrap_array(dig_response(response, response_nesting)) end |