Class: Rapuncel::Adapters::NetHttpAdapter::HttpResponse
- Inherits:
-
Object
- Object
- Rapuncel::Adapters::NetHttpAdapter::HttpResponse
- Defined in:
- lib/rapuncel/adapters/net_http_adapter.rb
Overview
Small response wrapper
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
-
#initialize(response) ⇒ HttpResponse
constructor
A new instance of HttpResponse.
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ HttpResponse
Returns a new instance of HttpResponse.
9 10 11 |
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 9 def initialize response @response = response end |
Instance Method Details
#body ⇒ Object
17 18 19 |
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 17 def body @response.body end |
#code ⇒ Object
21 22 23 |
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 21 def code @response.code end |
#success? ⇒ Boolean
13 14 15 |
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 13 def success? @response.is_a? Net::HTTPOK end |