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

Parameters:

  • created_at (String)
  • source (String)
  • name (String)
  • balance (String)
  • institution_name (String, nil) (defaults to: nil)
  • id (Integer, nil) (defaults to: nil)
  • zabo_account_id (Integer, nil) (defaults to: nil)
  • display_name (String, nil) (defaults to: nil)


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

#balanceString

Returns:

  • (String)


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

def balance
  @balance
end

#created_atString

Returns:

  • (String)


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

def created_at
  @created_at
end

#display_nameString?

Returns:

  • (String, nil)


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

def display_name
  @display_name
end

#idInteger?

Returns:

  • (Integer, nil)


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

def id
  @id
end

#institution_nameString?

Returns:

  • (String, nil)


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

def institution_name
  @institution_name
end

#nameString

Returns:

  • (String)


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

def name
  @name
end

#sourceString

Returns:

  • (String)


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

def source
  @source
end

#zabo_account_idInteger?

Returns:

  • (Integer, nil)


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

def 
  @zabo_account_id
end