Class: Iterable::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, T::Sig
Defined in:
lib/iterable/response.rb

Overview

Response class is used to get access to raw HTTP request info

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resp) ⇒ Response

Returns a new instance of Response.



23
24
25
26
# File 'lib/iterable/response.rb', line 23

def initialize(resp)
  @resp = resp
  @body = parsed_body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



15
16
17
# File 'lib/iterable/response.rb', line 15

def body
  @body
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


33
34
35
36
37
38
39
# File 'lib/iterable/response.rb', line 33

def success?
  case @resp.code.to_i
  when (200..299) then true
  else
    false
  end
end