Class: KintoBox::KintoRequest
- Inherits:
-
Object
- Object
- KintoBox::KintoRequest
- Defined in:
- lib/kinto_box/kinto_request.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(client, method, path, body = {}, headers: nil) ⇒ KintoRequest
constructor
A new instance of KintoRequest.
- #to_hash ⇒ Object
Constructor Details
#initialize(client, method, path, body = {}, headers: nil) ⇒ KintoRequest
Returns a new instance of KintoRequest.
5 6 7 8 9 10 11 |
# File 'lib/kinto_box/kinto_request.rb', line 5 def initialize(client, method, path, body = {}, headers: nil) @client = client @method = method @path = path @body = body @headers = headers end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/kinto_box/kinto_request.rb', line 3 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/kinto_box/kinto_request.rb', line 3 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/kinto_box/kinto_request.rb', line 3 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/kinto_box/kinto_request.rb', line 3 def path @path end |
Instance Method Details
#execute ⇒ Object
17 18 19 |
# File 'lib/kinto_box/kinto_request.rb', line 17 def execute @client.send_request(self) end |
#to_hash ⇒ Object
13 14 15 |
# File 'lib/kinto_box/kinto_request.rb', line 13 def to_hash { 'method' => method, 'path' => path, 'body' => body } end |