Class: BingAdsRubySdk::Services::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bing_ads_ruby_sdk/services/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(soap_client) ⇒ Base

Returns a new instance of Base.



13
14
15
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 13

def initialize(soap_client)
  @soap_client = soap_client
end

Class Method Details

.serviceObject



31
32
33
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 31

def self.service
  raise 'implement me'
end

Instance Method Details

#call(operation_name, message = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 17

def call(operation_name, message = {})
  camelized_name = BingAdsRubySdk::StringUtils.camelize(operation_name.to_s)
  response = soap_client.call(
    camelized_name,
    preprocess(message, camelized_name),
  )
  postprocess(response)
end

#call_wrapper(action, message, *response_nesting) ⇒ Object



26
27
28
29
# File 'lib/bing_ads_ruby_sdk/services/base.rb', line 26

def call_wrapper(action, message, *response_nesting)
  response = call(action, message)
  wrap_array(dig_response(response, response_nesting))
end