Class: LunchMoney::Objects::Asset
- Includes:
- Validators
- Defined in:
- lib/lunchmoney/objects/asset.rb
Overview
Constant Summary collapse
- VALID_TYPE_NAMES =
Valid asset type names
T.let( [ "cash", "credit", "investment", "real estate", "loan", "vehicle", "cryptocurrency", "employee compensation", "other liability", "other asset", "depository", ], T::Array[String], )
Instance Attribute Summary collapse
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#balance_as_of ⇒ Object
Returns the value of attribute balance_as_of.
-
#closed_on ⇒ Object
Returns the value of attribute closed_on.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#exclude_transactions ⇒ Object
Returns the value of attribute exclude_transactions.
-
#id ⇒ Object
Returns the value of attribute id.
-
#institution_name ⇒ Object
Returns the value of attribute institution_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#subtype_name ⇒ Object
Returns the value of attribute subtype_name.
-
#type_name ⇒ Object
Returns the value of attribute type_name.
Instance Method Summary collapse
-
#initialize(created_at:, type_name:, name:, balance:, balance_as_of:, currency:, exclude_transactions:, id:, subtype_name: nil, display_name: nil, closed_on: nil, institution_name: nil) ⇒ Asset
constructor
A new instance of Asset.
Methods included from Validators
#validate_iso8601!, #validate_one_of!
Methods inherited from Object
Constructor Details
#initialize(created_at:, type_name:, name:, balance:, balance_as_of:, currency:, exclude_transactions:, id:, subtype_name: nil, display_name: nil, closed_on: nil, institution_name: nil) ⇒ Asset
Returns a new instance of Asset.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/lunchmoney/objects/asset.rb', line 59 def initialize(created_at:, type_name:, name:, balance:, balance_as_of:, currency:, exclude_transactions:, id:, subtype_name: nil, display_name: nil, closed_on: nil, institution_name: nil) super() @created_at = T.let(validate_iso8601!(created_at), String) @type_name = T.let(validate_one_of!(type_name, VALID_TYPE_NAMES), String) @name = name @balance = balance @balance_as_of = T.let(validate_iso8601!(balance_as_of), String) @currency = currency @exclude_transactions = exclude_transactions @id = id @subtype_name = subtype_name @display_name = display_name @closed_on = closed_on @institution_name = institution_name end |
Instance Attribute Details
#balance ⇒ Object
Returns the value of attribute balance.
17 18 19 |
# File 'lib/lunchmoney/objects/asset.rb', line 17 def balance @balance end |
#balance_as_of ⇒ Object
Returns the value of attribute balance_as_of.
14 15 16 |
# File 'lib/lunchmoney/objects/asset.rb', line 14 def balance_as_of @balance_as_of end |
#closed_on ⇒ Object
Returns the value of attribute closed_on.
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def closed_on @closed_on end |
#created_at ⇒ Object
Returns the value of attribute created_at.
14 15 16 |
# File 'lib/lunchmoney/objects/asset.rb', line 14 def created_at @created_at end |
#currency ⇒ Object
Returns the value of attribute currency.
17 18 19 |
# File 'lib/lunchmoney/objects/asset.rb', line 17 def currency @currency end |
#display_name ⇒ Object
Returns the value of attribute display_name.
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def display_name @display_name end |
#exclude_transactions ⇒ Object
Returns the value of attribute exclude_transactions.
23 24 25 |
# File 'lib/lunchmoney/objects/asset.rb', line 23 def exclude_transactions @exclude_transactions end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/lunchmoney/objects/asset.rb', line 11 def id @id end |
#institution_name ⇒ Object
Returns the value of attribute institution_name.
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def institution_name @institution_name end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/lunchmoney/objects/asset.rb', line 17 def name @name end |
#subtype_name ⇒ Object
Returns the value of attribute subtype_name.
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def subtype_name @subtype_name end |
#type_name ⇒ Object
Returns the value of attribute type_name.
14 15 16 |
# File 'lib/lunchmoney/objects/asset.rb', line 14 def type_name @type_name end |