Class: PlayWhe::HTTP::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/playwhe/http.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/playwhe/http.rb', line 6

def response
  @response
end

Instance Method Details

#bodyObject



16
17
18
# File 'lib/playwhe/http.rb', line 16

def body
  response.to_s
end

#ok?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/playwhe/http.rb', line 20

def ok?
  status == 200
end

#statusObject



12
13
14
# File 'lib/playwhe/http.rb', line 12

def status
  response.status
end