Class: ApiaClient::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/apia_client/request.rb

Direct Known Subclasses

Delete, Get, Patch, Post, Put

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Request

Returns a new instance of Request.



19
20
21
22
# File 'lib/apia_client/request.rb', line 19

def initialize(path)
  @path = path
  @arguments = {}
end

Class Attribute Details

.methodObject

Returns the value of attribute method.



10
11
12
# File 'lib/apia_client/request.rb', line 10

def method
  @method
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



15
16
17
# File 'lib/apia_client/request.rb', line 15

def arguments
  @arguments
end

#http_open_timeoutObject

Returns the value of attribute http_open_timeout.



17
18
19
# File 'lib/apia_client/request.rb', line 17

def http_open_timeout
  @http_open_timeout
end

#http_read_timeoutObject

Returns the value of attribute http_read_timeout.



16
17
18
# File 'lib/apia_client/request.rb', line 16

def http_read_timeout
  @http_read_timeout
end

#pathObject (readonly)

Returns the value of attribute path.



14
15
16
# File 'lib/apia_client/request.rb', line 14

def path
  @path
end

Instance Method Details

#add_arguments_to_request(request) ⇒ Object



28
29
30
31
# File 'lib/apia_client/request.rb', line 28

def add_arguments_to_request(request)
  request['Content-Type'] = 'application/json'
  request.body = arguments.to_json
end

#path_for_net_httpObject



24
25
26
# File 'lib/apia_client/request.rb', line 24

def path_for_net_http
  path
end