Class: ApiaClient::Request
- Inherits:
-
Object
- Object
- ApiaClient::Request
- Defined in:
- lib/apia_client/request.rb
Class Attribute Summary collapse
-
.method ⇒ Object
Returns the value of attribute method.
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
-
#http_read_timeout ⇒ Object
Returns the value of attribute http_read_timeout.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #add_arguments_to_request(request) ⇒ Object
-
#initialize(path) ⇒ Request
constructor
A new instance of Request.
- #path_for_net_http ⇒ Object
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
.method ⇒ Object
Returns the value of attribute method.
10 11 12 |
# File 'lib/apia_client/request.rb', line 10 def method @method end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
15 16 17 |
# File 'lib/apia_client/request.rb', line 15 def arguments @arguments end |
#http_open_timeout ⇒ Object
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_timeout ⇒ Object
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 |
#path ⇒ Object (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_http ⇒ Object
24 25 26 |
# File 'lib/apia_client/request.rb', line 24 def path_for_net_http path end |