Class: Hipbot::Http::Response
- Inherits:
-
Struct
- Object
- Struct
- Hipbot::Http::Response
- Defined in:
- lib/hipbot/helpers/http.rb
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
- #headers ⇒ Object
-
#initialize(*args) ⇒ Response
constructor
A new instance of Response.
- #json ⇒ Object
Constructor Details
Instance Attribute Details
#raw_response ⇒ Object
Returns the value of attribute raw_response
41 42 43 |
# File 'lib/hipbot/helpers/http.rb', line 41 def raw_response @raw_response end |
Instance Method Details
#body ⇒ Object
47 48 49 |
# File 'lib/hipbot/helpers/http.rb', line 47 def body raw_response.response end |
#code ⇒ Object
51 52 53 |
# File 'lib/hipbot/helpers/http.rb', line 51 def code raw_response.response_header.status end |
#headers ⇒ Object
55 56 57 |
# File 'lib/hipbot/helpers/http.rb', line 55 def headers raw_response.response_header end |
#json ⇒ Object
59 60 61 |
# File 'lib/hipbot/helpers/http.rb', line 59 def json @json ||= JSON.parse(body) || {} end |