From 4f11c06d0477008de6e9dac3053296522f90871c Mon Sep 17 00:00:00 2001 From: mmenanno Date: Tue, 9 Apr 2024 20:38:00 -0400 Subject: [PATCH 1/2] update crypto object to have to_base attribute --- lib/lunchmoney/objects/crypto.rb | 7 ++++++- test/lunchmoney/objects/crypto_test.rb | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/lunchmoney/objects/crypto.rb b/lib/lunchmoney/objects/crypto.rb index c57ab5e..3aa8542 100644 --- a/lib/lunchmoney/objects/crypto.rb +++ b/lib/lunchmoney/objects/crypto.rb @@ -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, @@ -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 } diff --git a/test/lunchmoney/objects/crypto_test.rb b/test/lunchmoney/objects/crypto_test.rb index 5867cb8..59e7cfd 100644 --- a/test/lunchmoney/objects/crypto_test.rb +++ b/test/lunchmoney/objects/crypto_test.rb @@ -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 From 9ccfec6af4982c95ebdd14a80521de2bd7980fc0 Mon Sep 17 00:00:00 2001 From: mmenanno Date: Tue, 9 Apr 2024 20:39:11 -0400 Subject: [PATCH 2/2] bump gem version to 1.2.0 --- Gemfile.lock | 2 +- lib/lunchmoney/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f6715b9..5a31d3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/lib/lunchmoney/version.rb b/lib/lunchmoney/version.rb index 3a7eefb..59a2682 100644 --- a/lib/lunchmoney/version.rb +++ b/lib/lunchmoney/version.rb @@ -3,5 +3,5 @@ module LunchMoney # Current version of the gem - VERSION = "1.1.2" + VERSION = "1.2.0" end