Class: RestfulResource::Request
- Inherits:
-
Object
- Object
- RestfulResource::Request
- Defined in:
- lib/restful_resource/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#open_timeout ⇒ Object
readonly
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(method, url, headers: {}, body: nil, open_timeout: nil, timeout: nil) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(method, url, headers: {}, body: nil, open_timeout: nil, timeout: nil) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 10 11 12 |
# File 'lib/restful_resource/request.rb', line 5 def initialize(method, url, headers: {}, body: nil, open_timeout: nil, timeout: nil) @method = method @url = url @headers = headers @body = body @open_timeout = open_timeout @timeout = timeout end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/restful_resource/request.rb', line 3 def body @body end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/restful_resource/request.rb', line 3 def method @method end |
#open_timeout ⇒ Object (readonly)
Returns the value of attribute open_timeout.
3 4 5 |
# File 'lib/restful_resource/request.rb', line 3 def open_timeout @open_timeout end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/restful_resource/request.rb', line 3 def timeout @timeout end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/restful_resource/request.rb', line 3 def url @url end |
Instance Method Details
#headers ⇒ Object
14 15 16 |
# File 'lib/restful_resource/request.rb', line 14 def headers default_headers.merge(format_headers) end |