Class: PlayWhe::HTTP::Response
- Inherits:
-
Object
- Object
- PlayWhe::HTTP::Response
- Defined in:
- lib/playwhe/http.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #ok? ⇒ Boolean
- #status ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
8 9 10 |
# File 'lib/playwhe/http.rb', line 8 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/playwhe/http.rb', line 6 def response @response end |
Instance Method Details
#body ⇒ Object
16 17 18 |
# File 'lib/playwhe/http.rb', line 16 def body response.to_s end |
#ok? ⇒ Boolean
20 21 22 |
# File 'lib/playwhe/http.rb', line 20 def ok? status == 200 end |
#status ⇒ Object
12 13 14 |
# File 'lib/playwhe/http.rb', line 12 def status response.status end |