Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update crypto object to have to_base attribute #243

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
lunchmoney (1.1.2)
lunchmoney (1.2.0)
activesupport (>= 6.1)
faraday (>= 1.0.0)
sorbet-runtime (>= 0.5)
Expand Down
7 changes: 6 additions & 1 deletion lib/lunchmoney/objects/crypto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Crypto < CryptoBase
sig { returns(String) }
attr_accessor :currency, :status

sig { returns(T.nilable(Number)) }
attr_accessor :to_base

sig do
params(
created_at: String,
Expand All @@ -27,14 +30,16 @@ class Crypto < CryptoBase
id: T.nilable(Integer),
zabo_account_id: T.nilable(Integer),
display_name: T.nilable(String),
to_base: T.nilable(Number),
).void
end
def initialize(created_at:, source:, name:, balance:, balance_as_of:, currency:,
status:, institution_name: nil, id: nil, zabo_account_id: nil, display_name: nil)
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

sig { params(time: String).void }
Expand Down
2 changes: 1 addition & 1 deletion lib/lunchmoney/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

module LunchMoney
# Current version of the gem
VERSION = "1.1.2"
VERSION = "1.2.0"
end
1 change: 1 addition & 0 deletions test/lunchmoney/objects/crypto_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def create_crypto(source: "manual", balance_as_of: "2023-01-01T01:01:01.000Z", s
"institution_name": nil,
"status": status,
"created_at": created_at,
"to_base": 1.0,
)
end
end
Expand Down
Loading