Sha256: 07c6f70e167c3def0650ad96932d4222cf7f3901d2098285af0fe3ef84bcd987

Contents?: true

Size: 587 Bytes

Versions: 3

Compression:

Stored size: 587 Bytes

Contents

# frozen_string_literal: true

require 'time'
require 'credit_gateway/base_model'

module CreditGateway
  class BankConnection < BaseModel
    attributes :connection_id, :provider_id, :status, :creation_date_time, :status_update_date_time

    def self.build(json:)
      super.tap do |record|
        if record.creation_date_time
          record.creation_date_time = Time.parse(record.creation_date_time)
        end
        if record.status_update_date_time
          record.status_update_date_time = Time.parse(record.status_update_date_time)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
credit_gateway-0.3.2 lib/credit_gateway/bank_connection.rb
credit_gateway-0.3.1 lib/credit_gateway/bank_connection.rb
credit_gateway-0.3.0 lib/credit_gateway/bank_connection.rb