Class: Callapi::Call::Request::Api

Inherits:
Http
  • Object
show all
Defined in:
lib/callapi/call/request/api.rb

Constant Summary

Constants inherited from Http

Http::HTTP_METHOD_TO_REQUEST_CLASS

Instance Method Summary collapse

Methods inherited from Http

#response

Methods included from Http::LogHelper

#add_api_host_log, #add_request_headers_log, #add_request_params_log, #add_request_path_log, #add_response_log, #add_response_summary_log, #with_logging

Methods inherited from Base

#initialize, #response

Constructor Details

This class inherits a constructor from Callapi::Call::Request::Base

Instance Method Details

#api_path_prefixObject



12
13
14
15
# File 'lib/callapi/call/request/api.rb', line 12

def api_path_prefix
  return Callapi::Config.api_path_prefix if Callapi::Config.api_path_prefix  # backward compatibility
  URI(Callapi::Config.api_host).path
end

#hostObject



2
3
4
# File 'lib/callapi/call/request/api.rb', line 2

def host
  Callapi::Config.api_host || raise(Callapi::ApiHostNotSetError)
end

#uriObject



6
7
8
9
10
# File 'lib/callapi/call/request/api.rb', line 6

def uri
  @uri ||= super.tap do |uri|
    uri.path = api_path_prefix + request_path
  end
end