class PMP::Response
Attributes
raw[RW]
request[RW]
Public Class Methods
new(raw, request)
click to toggle source
# File lib/pmp/response.rb, line 6 def initialize(raw, request) @raw = raw @request = request # check_for_error(raw) end
Public Instance Methods
body()
click to toggle source
def check_for_error(response)
status_code_type = response.status.to_s[0] case status_code_type when "2" # puts "all is well, status: #{response.status}" when "4", "5" raise "Whoops, error back from PMP: #{response.status}" else raise "Unrecongized status code: #{response.status}" end
end
# File lib/pmp/response.rb, line 25 def body self.raw.body end