Class: Workarea::Zipco::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/workarea/zipco/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



4
5
6
# File 'lib/workarea/zipco/response.rb', line 4

def initialize(response)
  @response = response
end

Instance Method Details

#bodyObject



20
21
22
# File 'lib/workarea/zipco/response.rb', line 20

def body
  @body ||= JSON.parse(@response.body)
end

#redirect_uriObject



16
17
18
# File 'lib/workarea/zipco/response.rb', line 16

def redirect_uri
  body["uri"]
end

#statusObject



24
25
26
# File 'lib/workarea/zipco/response.rb', line 24

def status
  @response.status
end

#success?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/workarea/zipco/response.rb', line 8

def success?
  @response.success?
end

#zipco_order_idObject



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

def zipco_order_id
  body["id"]
end