Class: LunchMoney::Objects::CryptoBase

Inherits:
Object
  • Object
show all
Includes:
Validators
Defined in:
lib/lunchmoney/objects/crypto_base.rb

Overview

Direct Known Subclasses

Crypto

Constant Summary collapse

VALID_SOURCES =

Valid crypto source types

T.let(
  [
    "synced",
    "manual",
  ],
  T::Array[String],
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validators

#validate_iso8601!, #validate_one_of!

Methods inherited from Object

#serialize

Constructor Details

#initialize(created_at:, source:, name:, balance:, institution_name: nil, id: nil, zabo_account_id: nil, display_name: nil) ⇒ CryptoBase

Returns a new instance of CryptoBase.



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/lunchmoney/objects/crypto_base.rb', line 43

def initialize(created_at:, source:, name:, balance:, institution_name: nil, id: nil, zabo_account_id: nil,
  display_name: nil)
  super()
  @created_at = T.let(validate_iso8601!(created_at), String)
  @source = T.let(validate_one_of!(source, VALID_SOURCES), String)
  @name = name
  @balance = balance
  @institution_name = institution_name
  @id = id
  @zabo_account_id = 
  @display_name = display_name
end

Instance Attribute Details

#balanceObject

Returns the value of attribute balance.



17
18
19
# File 'lib/lunchmoney/objects/crypto_base.rb', line 17

def balance
  @balance
end

#created_atObject

Returns the value of attribute created_at.



14
15
16
# File 'lib/lunchmoney/objects/crypto_base.rb', line 14

def created_at
  @created_at
end

#display_nameObject

Returns the value of attribute display_name.



20
21
22
# File 'lib/lunchmoney/objects/crypto_base.rb', line 20

def display_name
  @display_name
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/lunchmoney/objects/crypto_base.rb', line 11

def id
  @id
end

#institution_nameObject

Returns the value of attribute institution_name.



20
21
22
# File 'lib/lunchmoney/objects/crypto_base.rb', line 20

def institution_name
  @institution_name
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/lunchmoney/objects/crypto_base.rb', line 17

def name
  @name
end

#sourceObject

Returns the value of attribute source.



14
15
16
# File 'lib/lunchmoney/objects/crypto_base.rb', line 14

def source
  @source
end

#zabo_account_idObject

Returns the value of attribute zabo_account_id.



11
12
13
# File 'lib/lunchmoney/objects/crypto_base.rb', line 11

def 
  @zabo_account_id
end