Class: LunchMoney::Calls::Crypto
- Defined in:
- lib/lunchmoney/calls/crypto.rb
Overview
https://lunchmoney.dev/#crypto
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#crypto ⇒ Array<LunchMoney::Objects::Crypto>, LunchMoney::Errors
-
#update_crypto(crypto_id, name: nil, display_name: nil, institution_name: nil, balance: nil, currency: nil) ⇒ LunchMoney::Objects::CryptoBase, LunchMoney::Errors
Methods inherited from Base
Constructor Details
This class inherits a constructor from LunchMoney::Calls::Base
Instance Method Details
#crypto ⇒ Array<LunchMoney::Objects::Crypto>, LunchMoney::Errors
11 12 13 14 15 16 17 18 19 |
# File 'lib/lunchmoney/calls/crypto.rb', line 11 def crypto response = get("crypto") handle_api_response(response) do |body| body[:crypto].map do |crypto| LunchMoney::Objects::Crypto.new(**crypto) end end end |
#update_crypto(crypto_id, name: nil, display_name: nil, institution_name: nil, balance: nil, currency: nil) ⇒ LunchMoney::Objects::CryptoBase, LunchMoney::Errors
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/lunchmoney/calls/crypto.rb', line 31 def update_crypto(crypto_id, name: nil, display_name: nil, institution_name: nil, balance: nil, currency: nil) params = clean_params({ name:, display_name:, institution_name:, balance:, currency:, }) response = put("crypto/manual/#{crypto_id}", params) handle_api_response(response) do |body| LunchMoney::Objects::CryptoBase.new(**body) end end |