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

Returns a new instance of Crypto.



32
33
34
35
36
37
38
# File 'lib/lunchmoney/objects/crypto.rb', line 32

def initialize(created_at:, source:, name:, balance:, balance_as_of:, currency:,
  status:, institution_name: nil, id: nil, zabo_account_id: nil, display_name: 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
end

Instance Attribute Details

#balance_as_ofObject

Returns the value of attribute balance_as_of.



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

def balance_as_of
  @balance_as_of
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end