Class: LunchMoney::Api
- Inherits:
-
Object
- Object
- LunchMoney::Api
- Defined in:
- lib/lunchmoney/api.rb
Overview
The main API class that a user should interface through. The method of any individual call is delegated through here
so that it is never necessary to go through things like LunchMoney::Calls::Users.new.user
instead you can directly
call the endpoint with LunchMoney::Api.new.user and it will be delegated to the correct call.
Instance Attribute Summary collapse
-
#api_key ⇒ String?
readonly
Instance Method Summary collapse
-
#asset_calls ⇒ LunchMoney::Calls::Base
All assets call types come through here.
-
#budget_calls ⇒ LunchMoney::Calls::Base
All budget call types come through here.
-
#category_calls ⇒ LunchMoney::Calls::Base
All category call types come through here.
-
#crypto_calls ⇒ LunchMoney::Calls::Base
All crypto call types come through here.
-
#initialize(api_key: nil) ⇒ void
constructor
-
#plaid_account_calls ⇒ LunchMoney::Calls::Base
All Plaid accounts call types come through here.
-
#recurring_expense_calls ⇒ LunchMoney::Calls::Base
All recurring expenses call types come through here.
-
#tag_calls ⇒ LunchMoney::Calls::Base
All tags call types come through here.
-
#transaction_calls ⇒ LunchMoney::Calls::Base
All transaction call types come through here.
-
#user_calls ⇒ LunchMoney::Calls::Base
All user call types come through here.
Constructor Details
#initialize(api_key: nil) ⇒ void
33 34 35 |
# File 'lib/lunchmoney/api.rb', line 33 def initialize(api_key: nil) @api_key = T.let(api_key || LunchMoney.configuration.api_key, T.nilable(String)) end |
Instance Attribute Details
#api_key ⇒ String? (readonly)
30 31 32 |
# File 'lib/lunchmoney/api.rb', line 30 def api_key @api_key end |
Instance Method Details
#asset_calls ⇒ LunchMoney::Calls::Base
All assets call types come through here.
206 207 208 |
# File 'lib/lunchmoney/api.rb', line 206 def asset_calls memoized_call_instance(:@asset_calls, LunchMoney::Calls::Assets) end |
#budget_calls ⇒ LunchMoney::Calls::Base
All budget call types come through here.
185 186 187 |
# File 'lib/lunchmoney/api.rb', line 185 def budget_calls memoized_call_instance(:@budget_calls, LunchMoney::Calls::Budgets) end |
#category_calls ⇒ LunchMoney::Calls::Base
All category call types come through here. Reference the docs for available parameters for each call
85 86 87 |
# File 'lib/lunchmoney/api.rb', line 85 def category_calls memoized_call_instance(:@category_calls, LunchMoney::Calls::Categories) end |
#crypto_calls ⇒ LunchMoney::Calls::Base
All crypto call types come through here.
234 235 236 |
# File 'lib/lunchmoney/api.rb', line 234 def crypto_calls memoized_call_instance(:@crypto_calls, LunchMoney::Calls::Crypto) end |
#plaid_account_calls ⇒ LunchMoney::Calls::Base
All Plaid accounts call types come through here.
220 221 222 |
# File 'lib/lunchmoney/api.rb', line 220 def plaid_account_calls memoized_call_instance(:@plaid_account_calls, LunchMoney::Calls::PlaidAccounts) end |
#recurring_expense_calls ⇒ LunchMoney::Calls::Base
All recurring expenses call types come through here.
168 169 170 |
# File 'lib/lunchmoney/api.rb', line 168 def recurring_expense_calls memoized_call_instance(:@recurring_expense_calls, LunchMoney::Calls::RecurringExpenses) end |
#tag_calls ⇒ LunchMoney::Calls::Base
All tags call types come through here.
96 97 98 |
# File 'lib/lunchmoney/api.rb', line 96 def tag_calls memoized_call_instance(:@tag_calls, LunchMoney::Calls::Tags) end |
#transaction_calls ⇒ LunchMoney::Calls::Base
All transaction call types come through here.
157 158 159 |
# File 'lib/lunchmoney/api.rb', line 157 def transaction_calls memoized_call_instance(:@transaction_calls, LunchMoney::Calls::Transactions) end |
#user_calls ⇒ LunchMoney::Calls::Base
All user call types come through here.
44 45 46 |
# File 'lib/lunchmoney/api.rb', line 44 def user_calls memoized_call_instance(:@user_calls, LunchMoney::Calls::Users) end |