Class: Iterable::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/iterable/response.rb', line 12

def body
  @body
end

Instance Method Details

#success?Boolean

Convenience method to determine if request was successfull or not

Returns:

  • (Boolean)


24
25
26
27
28
29
30
# File 'lib/iterable/response.rb', line 24

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