Skip to content

Commit

Permalink
Merge pull request #243 from mmenanno/update-crypto-object
Browse files Browse the repository at this point in the history
update crypto object to have to_base attribute
  • Loading branch information
mmenanno committed Apr 10, 2024
2 parents ef94a52 + 9ccfec6 commit 008cd16
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
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

0 comments on commit 008cd16

Please sign in to comment.