-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from halorrr/improve-budget-recurring-type
add better typing to recurring field on budget returns
- Loading branch information
Showing
6 changed files
with
77 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
lib/lunchmoney/recurring_expenses/recurring_expense/recurring_expense_base.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
module LunchMoney | ||
# https://lunchmoney.dev/#recurring-expenses-object | ||
class RecurringExpenseBase < LunchMoney::DataObject | ||
sig { returns(String) } | ||
attr_accessor :payee, :currency, :amount | ||
|
||
sig { returns(T.nilable(Integer)) } | ||
attr_accessor :to_base | ||
|
||
sig do | ||
params( | ||
payee: String, | ||
amount: String, | ||
currency: String, | ||
to_base: T.nilable(Integer), | ||
).void | ||
end | ||
def initialize(payee:, amount:, currency:, to_base:) | ||
super() | ||
@payee = payee | ||
@amount = amount | ||
@currency = currency | ||
@to_base = to_base | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.