class Redex::Response::BaseResponse

Attributes

code[R]
message[R]
raw[R]
sequential_id[R]
transaction_id[R]

Public Class Methods

new(raw_response) click to toggle source
# File lib/redex/response/base_response.rb, line 6
def initialize(raw_response)
        @raw = clear(raw_response)
end

Public Instance Methods

clear(httpi_result) click to toggle source
# File lib/redex/response/base_response.rb, line 10
def clear(httpi_result)
        httpi_result = Hash[httpi_result.map { |k, v| [k.to_sym, v] }]
        httpi_result.select! {|k,v| v != [{"i:nil"=>"true"}]}
        httpi_result.each { |k, v| httpi_result[k] = v.first }
end
datetime_sanitize(raw_date, raw_time) click to toggle source
# File lib/redex/response/base_response.rb, line 32
def datetime_sanitize(raw_date, raw_time)
        if raw_date && raw_time
                DateTime.strptime(raw_date + raw_time + '-03:00', '%Y%m%d%H:%M:%S%z')
        end
end