Class: Remitmd::Tab

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

Returns a new instance of Tab.



209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/remitmd/models.rb', line 209

def initialize(attrs)
  h = attrs.transform_keys(&:to_s)
  @id          = h["id"]
  @payer       = h["payer"] || h["opener"]
  @payee       = h["payee"] || h["provider"] || h["counterpart"]
  @limit       = decimal(h["limit_amount"] || h["limit"])
  @spent       = decimal(h["spent"] || h["used"] || "0")
  @remaining   = decimal(h["remaining"] || h["limit_amount"] || h["limit"])
  @status      = h["status"]
  @created_at  = parse_time(h["created_at"])
  @closes_at   = parse_time(h["closes_at"])
end

Instance Attribute Details

#closes_atObject (readonly)

Returns the value of attribute closes_at.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def closes_at
  @closes_at
end

#created_atObject (readonly)

Returns the value of attribute created_at.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def id
  @id
end

#limitObject (readonly)

Returns the value of attribute limit.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def limit
  @limit
end

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

Returns the value of attribute payee.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def payee
  @payee
end

#payerObject (readonly) Also known as: opener

Returns the value of attribute payer.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def payer
  @payer
end

#remainingObject (readonly)

Returns the value of attribute remaining.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def remaining
  @remaining
end

#spentObject (readonly) Also known as: used

Returns the value of attribute spent.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def spent
  @spent
end

#statusObject (readonly)

Returns the value of attribute status.



222
223
224
# File 'lib/remitmd/models.rb', line 222

def status
  @status
end