Class: Remitmd::Deposit

Inherits:
Model
  • Object
show all
Defined in:
lib/remitmd/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#inspect, #to_h

Constructor Details

#initialize(attrs) ⇒ Deposit

Returns a new instance of Deposit.



330
331
332
333
334
335
336
337
338
339
# File 'lib/remitmd/models.rb', line 330

def initialize(attrs)
  h = attrs.transform_keys(&:to_s)
  @id          = h["id"]
  @payer       = h["payer"] || h["depositor"]
  @payee       = h["payee"] || h["provider"] || h["beneficiary"]
  @amount      = decimal(h["amount"])
  @status      = h["status"]
  @expires_at  = parse_time(h["expires_at"])
  @created_at  = parse_time(h["created_at"])
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def created_at
  @created_at
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def expires_at
  @expires_at
end

#idObject (readonly)

Returns the value of attribute id.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def id
  @id
end

#payeeObject (readonly) Also known as: provider, beneficiary

Returns the value of attribute payee.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def payee
  @payee
end

#payerObject (readonly) Also known as: depositor

Returns the value of attribute payer.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def payer
  @payer
end

#statusObject (readonly)

Returns the value of attribute status.



341
342
343
# File 'lib/remitmd/models.rb', line 341

def status
  @status
end