Class: Iterable::Response
- Inherits:
-
Object
- Object
- Iterable::Response
- 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
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(resp) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
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
#body ⇒ Object (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
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 |