Class: MojFileUploaderApiClient::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/mojfile_uploader_api_client/http_client.rb

Direct Known Subclasses

AddFile, DeleteFile, ListFiles, Status

Constant Summary collapse

DEFAULT_OPTIONS =
{
  headers: {'Content-Type' => 'application/json', 'Accept' => 'application/json'},
  verify_ssl: false,
  open_timeout: 5,
  read_timeout: 15
}.freeze

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.base_urlObject

Returns the value of attribute base_url.



13
14
15
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 13

def base_url
  @base_url
end

.optionsObject

Returns the value of attribute options.



13
14
15
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 13

def options
  @options
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



3
4
5
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 3

def response
  @response
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



15
16
17
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 15

def configure
  yield(self)
end

Instance Method Details

#callObject



20
21
22
23
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 20

def call
  execute_request
  response
end

#endpointObject



25
26
27
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 25

def endpoint
  raise 'not implemented'
end

#optionsObject



39
40
41
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 39

def options
  DEFAULT_OPTIONS.merge(HttpClient.options || {})
end

#payloadObject



33
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 33

def payload; end

#payload?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 35

def payload?
  !payload.nil?
end

#verbObject



29
30
31
# File 'lib/mojfile_uploader_api_client/http_client.rb', line 29

def verb
  raise 'not implemented'
end