Class: CreditGateway::Balance

Inherits:
BaseModel show all
Defined in:
lib/credit_gateway/balance.rb

Class Method Summary collapse

Methods inherited from BaseModel

#as_json, attribute_aliases, attributes, #initialize, key_transformer

Constructor Details

This class inherits a constructor from CreditGateway::BaseModel

Class Method Details

.build(json:) ⇒ Object



12
13
14
15
16
17
# File 'lib/credit_gateway/balance.rb', line 12

def self.build(json:)
  super.tap do |record|
    record.amount = Amount.build(json: (record.amount || {}))
    record.date_time = Time.parse(record.date_time) if record.date_time
  end
end