lib/chargify2/representations/call.rb in chargify2-0.2.5 vs lib/chargify2/representations/call.rb in chargify2-0.2.6

- old
+ new

@@ -5,26 +5,29 @@ property :timestamp property :nonce property :success property :request property :response + + Request = Class.new(Hashery::OpenCascade) + Response = Class.new(Hashery::OpenCascade) def request - Request[self[:request] || {}] + h = self[:request] || {} + Request[h.recursive_symbolize_keys] end def response - Response[self[:response] || {}] + h = self[:response] || {} + Response[h.recursive_symbolize_keys] end def successful? response.result.status_code.to_s == '200' end def errors - (response.result.errors || []).map {|e| Hashery::OpenCascade[e.symbolize_keys]} + (response.result.errors || []).map {|e| Hashery::OpenCascade[e.recursive_symbolize_keys]} end - class Request < Hashery::OpenCascade; end - class Response < Hashery::OpenCascade; end end end