Class: Rapuncel::Adapters::NetHttpAdapter::HttpResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/rapuncel/adapters/net_http_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HttpResponse

Returns a new instance of HttpResponse.



10
11
12
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 10

def initialize response
  @response = response
end

Instance Method Details

#bodyObject



18
19
20
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 18

def body
  @response.body
end

#codeObject



22
23
24
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 22

def code
  @response.code
end

#success?Boolean

Returns:



14
15
16
# File 'lib/rapuncel/adapters/net_http_adapter.rb', line 14

def success?
  @response.is_a? Net::HTTPOK
end