class Giftrocket::Error
Public Class Methods
new(response)
click to toggle source
Calls superclass method
# File lib/giftrocket/error.rb, line 4 def initialize(response) @response = response super end
Public Instance Methods
message()
click to toggle source
# File lib/giftrocket/error.rb, line 9 def message response_json = JSON.parse(@response.body).with_indifferent_access errors = response_json[:errors] "Code: #{@response.code}; Data: #{errors}" end