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

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

Overview

Small response wrapper

Instance Method Summary collapse

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

#bodyObject



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

def body
  @response.body
end

#codeObject



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

def code
  @response.code
end

#success?Boolean

Returns:

  • (Boolean)


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

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