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 ⇒ String
- #balance_as_of ⇒ String
- #closed_on ⇒ String?
- #created_at ⇒ String
- #currency ⇒ String
- #display_name ⇒ String?
- #exclude_transactions ⇒ Boolean
- #id ⇒ Integer
- #institution_name ⇒ String?
- #name ⇒ String
- #subtype_name ⇒ String?
- #type_name ⇒ String
Instance Method Summary collapse
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) ⇒ void
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 ⇒ String
17 18 19 |
# File 'lib/lunchmoney/objects/asset.rb', line 17 def balance @balance end |
#balance_as_of ⇒ String
14 15 16 |
# File 'lib/lunchmoney/objects/asset.rb', line 14 def balance_as_of @balance_as_of end |
#closed_on ⇒ String?
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def closed_on @closed_on end |
#created_at ⇒ String
14 15 16 |
# File 'lib/lunchmoney/objects/asset.rb', line 14 def created_at @created_at end |
#currency ⇒ String
17 18 19 |
# File 'lib/lunchmoney/objects/asset.rb', line 17 def currency @currency end |
#display_name ⇒ String?
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def display_name @display_name end |
#exclude_transactions ⇒ Boolean
23 24 25 |
# File 'lib/lunchmoney/objects/asset.rb', line 23 def exclude_transactions @exclude_transactions end |
#id ⇒ Integer
11 12 13 |
# File 'lib/lunchmoney/objects/asset.rb', line 11 def id @id end |
#institution_name ⇒ String?
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def institution_name @institution_name end |
#name ⇒ String
17 18 19 |
# File 'lib/lunchmoney/objects/asset.rb', line 17 def name @name end |
#subtype_name ⇒ String?
20 21 22 |
# File 'lib/lunchmoney/objects/asset.rb', line 20 def subtype_name @subtype_name end |
#type_name ⇒ String
14 15 16 |
# File 'lib/lunchmoney/objects/asset.rb', line 14 def type_name @type_name end |