Class: AkamaiApi::ECCU::BaseRequest Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/akamai_api/eccu/base_request.rb

Overview

This class is abstract.

This class is intended as a generic superclass for all the specific requests that can be used with the Akamai ECCU interface

Direct Known Subclasses

BaseEditRequest, ListRequest, PublishRequest

Instance Method Summary collapse

Instance Method Details

#clientObject (protected)



28
29
30
# File 'lib/akamai_api/eccu/base_request.rb', line 28

def client
  AkamaiApi::ECCU.client
end

#client_call(method, *args) ⇒ Object (protected)

Executes a method via Savon and returns the response

Parameters:

  • method (String)

    method name to call

  • args

    additional arguments to pass to savon when calling the method

Returns:

  • (Object)

    the object containing the received response



24
25
26
# File 'lib/akamai_api/eccu/base_request.rb', line 24

def client_call method, *args
  client.call(method, *args).body["#{method}_response".to_sym]
end

#with_soap_error_handling(&block) ⇒ Object (protected)

Wrapper method that you can use inside your custom ECCU request to handle common errors

Raises:



13
14
15
16
17
18
# File 'lib/akamai_api/eccu/base_request.rb', line 13

def with_soap_error_handling &block
  yield
rescue Savon::HTTPError => e
  e = ::AkamaiApi::Unauthorized if e.http.code == 401
  raise e
end