Class: Lago::Api::Resources::Wallet

Inherits:
Base
  • Object
show all
Defined in:
lib/lago/api/resources/wallet.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#create, #destroy, #get, #get_all, #initialize, #update

Constructor Details

This class inherits a constructor from Lago::Api::Resources::Base

Instance Method Details

#api_resourceObject



7
8
9
# File 'lib/lago/api/resources/wallet.rb', line 7

def api_resource
  'wallets'
end

#root_nameObject



11
12
13
# File 'lib/lago/api/resources/wallet.rb', line 11

def root_name
  'wallet'
end

#whitelist_params(params) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/lago/api/resources/wallet.rb', line 15

def whitelist_params(params)
  {
    root_name => {
      external_customer_id: params[:external_customer_id],
      rate_amount: params[:rate_amount],
      name: params[:name],
      paid_credits: params[:paid_credits],
      granted_credits: params[:granted_credits],
      currency: params[:currency],
      expiration_at: params[:expiration_at],
    }.compact,
  }
end