Class: Kruger::Client::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/kruger/client/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ Response

Returns a new instance of Response.



8
9
10
# File 'lib/kruger/client/response.rb', line 8

def initialize(response = nil)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/kruger/client/response.rb', line 6

def response
  @response
end

Instance Method Details

#bodyObject



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

def body
  response.parsed_response
end

#statusObject



20
21
22
# File 'lib/kruger/client/response.rb', line 20

def status
  response.code
end

#success?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/kruger/client/response.rb', line 16

def success?
  response.success?
end