Class: Gorilla::Response
- Inherits:
-
Object
- Object
- Gorilla::Response
- Defined in:
- lib/gorilla/response.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
- #error ⇒ Object
- #error? ⇒ Boolean
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #status ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/gorilla/response.rb', line 6 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/gorilla/response.rb', line 4 def response @response end |
Instance Method Details
#body ⇒ Object
10 11 12 |
# File 'lib/gorilla/response.rb', line 10 def body response.body end |
#error ⇒ Object
26 27 28 |
# File 'lib/gorilla/response.rb', line 26 def error body[:error] end |
#error? ⇒ Boolean
22 23 24 |
# File 'lib/gorilla/response.rb', line 22 def error? body[:error] != nil end |
#status ⇒ Object
14 15 16 |
# File 'lib/gorilla/response.rb', line 14 def status response.status end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/gorilla/response.rb', line 18 def success? !error? end |