Class: XeroCLI::Commands::Accounts

Inherits:
Base
  • Object
show all
Defined in:
lib/xero_cli/commands/accounts.rb

Instance Method Summary collapse

Methods inherited from Base

#format_date, #money_to_cents, #read_guid, #xero_api

Constructor Details

#initialize(options) ⇒ Accounts

Returns a new instance of Accounts.



2
3
4
# File 'lib/xero_cli/commands/accounts.rb', line 2

def initialize(options)
  @show_accounts = options.show_accounts
end

Instance Method Details

#performObject



6
7
8
9
10
# File 'lib/xero_cli/commands/accounts.rb', line 6

def perform
  accounts = (show_accounts == 'ALL' ? nil : show_accounts)
  XeroCLI::AccountsStorage.set(accounts.map(&:to_h))
  ap accounts
end