Class: Remitmd::Tab
Instance Attribute Summary collapse
-
#closes_at ⇒ Object
readonly
Returns the value of attribute closes_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#payee ⇒ Object
(also: #provider, #counterpart)
readonly
Returns the value of attribute payee.
-
#payer ⇒ Object
(also: #opener)
readonly
Returns the value of attribute payer.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
-
#spent ⇒ Object
(also: #used)
readonly
Returns the value of attribute spent.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Tab
constructor
A new instance of Tab.
Methods inherited from Model
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_at ⇒ Object (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_at ⇒ Object (readonly)
Returns the value of attribute created_at.
222 223 224 |
# File 'lib/remitmd/models.rb', line 222 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
222 223 224 |
# File 'lib/remitmd/models.rb', line 222 def id @id end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
222 223 224 |
# File 'lib/remitmd/models.rb', line 222 def limit @limit end |
#payee ⇒ Object (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 |
#payer ⇒ Object (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 |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
222 223 224 |
# File 'lib/remitmd/models.rb', line 222 def remaining @remaining end |
#spent ⇒ Object (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 |
#status ⇒ Object (readonly)
Returns the value of attribute status.
222 223 224 |
# File 'lib/remitmd/models.rb', line 222 def status @status end |