Class: LunchMoney::Objects::Crypto

Inherits:
CryptoBase show all
Includes:
Validators
Defined in:
lib/lunchmoney/objects/crypto.rb

Overview

Constant Summary

Constants inherited from CryptoBase

LunchMoney::Objects::CryptoBase::VALID_SOURCES

Instance Attribute Summary collapse

Attributes inherited from CryptoBase

#balance, #created_at, #display_name, #id, #institution_name, #name, #source, #zabo_account_id

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:, balance_as_of:, currency:, status:, institution_name: nil, id: nil, zabo_account_id: nil, display_name: nil, to_base: nil) ⇒ void

Parameters:

  • created_at (String)
  • source (String)
  • name (String)
  • balance (String)
  • balance_as_of (String)
  • currency (String)
  • status (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)
  • to_base (Number, nil) (defaults to: nil)


36
37
38
39
40
41
42
43
# File 'lib/lunchmoney/objects/crypto.rb', line 36

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

Instance Attribute Details

#balance_as_ofString

Returns:

  • (String)


12
13
14
# File 'lib/lunchmoney/objects/crypto.rb', line 12

def balance_as_of
  @balance_as_of
end

#currencyString

Returns:

  • (String)


15
16
17
# File 'lib/lunchmoney/objects/crypto.rb', line 15

def currency
  @currency
end

#statusString

Returns:

  • (String)


15
16
17
# File 'lib/lunchmoney/objects/crypto.rb', line 15

def status
  @status
end

#to_baseNumber?

Returns:



18
19
20
# File 'lib/lunchmoney/objects/crypto.rb', line 18

def to_base
  @to_base
end