class Workarea::Afterpay::Response
Public Class Methods
new(response)
click to toggle source
# File lib/workarea/afterpay/response.rb, line 4 def initialize(response) @response = response end
Public Instance Methods
body()
click to toggle source
# File lib/workarea/afterpay/response.rb, line 12 def body return {} unless @response.body.present? && @response.body != "null" JSON.parse(@response.body) end
status()
click to toggle source
# File lib/workarea/afterpay/response.rb, line 17 def status @response.status end
success?()
click to toggle source
# File lib/workarea/afterpay/response.rb, line 8 def success? @response.present? && (@response.status == 201 || @response.status == 200) end