Class: AsposeEmailCloud::ApiInvoker

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-email-cloud/api_invoker.rb

Overview

API client invoker. Processes all requests and obtains actual token if necessary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client) ⇒ ApiInvoker

Returns a new instance of ApiInvoker.



33
34
35
# File 'lib/aspose-email-cloud/api_invoker.rb', line 33

def initialize(api_client)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject (readonly)

Returns the value of attribute api_client.



31
32
33
# File 'lib/aspose-email-cloud/api_invoker.rb', line 31

def api_client
  @api_client
end

Instance Method Details

#make_request(http_request, method, return_type) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/aspose-email-cloud/api_invoker.rb', line 37

def make_request(http_request, method, return_type)
  call_api(http_request, method, return_type)
rescue ApiError => e
  if e.code.equal? 401
    request_token
    return call_api(http_request, method, return_type)
  end
  raise
end