Class: Centrifuge::Request
- Inherits:
-
Object
- Object
- Centrifuge::Request
- Defined in:
- lib/centrifuge/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#client ⇒ Object
Returns the value of attribute client.
-
#head ⇒ Object
Returns the value of attribute head.
-
#params ⇒ Object
Returns the value of attribute params.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(client, verb, uri, params, body = nil, head = {}) ⇒ Request
constructor
A new instance of Request.
- #send ⇒ Object
Constructor Details
#initialize(client, verb, uri, params, body = nil, head = {}) ⇒ Request
Returns a new instance of Request.
7 8 9 10 |
# File 'lib/centrifuge/request.rb', line 7 def initialize(client, verb, uri, params, body = nil, head = {}) @client, @verb, @uri, @params, @body = client, verb, uri, params, body @head = head end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/centrifuge/request.rb', line 5 def body @body end |
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/centrifuge/request.rb', line 5 def client @client end |
#head ⇒ Object
Returns the value of attribute head.
5 6 7 |
# File 'lib/centrifuge/request.rb', line 5 def head @head end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/centrifuge/request.rb', line 5 def params @params end |
#uri ⇒ Object
Returns the value of attribute uri.
5 6 7 |
# File 'lib/centrifuge/request.rb', line 5 def uri @uri end |
#verb ⇒ Object
Returns the value of attribute verb.
5 6 7 |
# File 'lib/centrifuge/request.rb', line 5 def verb @verb end |
Instance Method Details
#send ⇒ Object
12 13 14 15 16 |
# File 'lib/centrifuge/request.rb', line 12 def send response = request_or_rescue body = response.body ? response.body.chomp : nil handle_response(response.code.to_i, body) end |