Class: XeroCLI::Commands::Balance
- Defined in:
- lib/xero_cli/commands/balance.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Balance
constructor
A new instance of Balance.
- #perform ⇒ Object
Methods inherited from Base
#format_date, #money_to_cents, #read_guid, #xero_api
Constructor Details
#initialize(options) ⇒ Balance
Returns a new instance of Balance.
2 3 4 |
# File 'lib/xero_cli/commands/balance.rb', line 2 def initialize() @bank_name = .balance end |
Instance Method Details
#perform ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/xero_cli/commands/balance.rb', line 6 def perform balance = get_balance(bank_name) result = JSON.parse(balance)['balance'] ap "#{bank_name}: #{result}" rescue StandardError ap "Couldn't find bank with name '#{bank_name}'" end |