Class: Remitmd::Escrow

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) ⇒ Escrow

Returns a new instance of Escrow.



187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/remitmd/models.rb', line 187

def initialize(attrs)
  h = attrs.transform_keys(&:to_s)
  @id         = h["invoice_id"] || h["id"]
  @payer      = h["payer"]
  @payee      = h["payee"]
  @amount     = decimal(h["amount"])
  @fee        = decimal(h["fee"] || "0")
  @status     = h["status"]
  @memo       = h["memo"] || ""
  @milestones = h["milestones"] || []
  @splits     = h["splits"] || []
  @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.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def created_at
  @created_at
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def expires_at
  @expires_at
end

#feeObject (readonly)

Returns the value of attribute fee.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def fee
  @fee
end

#idObject (readonly)

Returns the value of attribute id.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def id
  @id
end

#memoObject (readonly)

Returns the value of attribute memo.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def memo
  @memo
end

#milestonesObject (readonly)

Returns the value of attribute milestones.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def milestones
  @milestones
end

#payeeObject (readonly)

Returns the value of attribute payee.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def payee
  @payee
end

#payerObject (readonly)

Returns the value of attribute payer.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def payer
  @payer
end

#splitsObject (readonly)

Returns the value of attribute splits.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def splits
  @splits
end

#statusObject (readonly)

Returns the value of attribute status.



202
203
204
# File 'lib/remitmd/models.rb', line 202

def status
  @status
end