Class: XeroCLI::Commands::Base
- Inherits:
-
Object
- Object
- XeroCLI::Commands::Base
show all
- Defined in:
- lib/xero_cli/commands/base.rb
Instance Method Summary
collapse
Instance Method Details
16
17
18
|
# File 'lib/xero_cli/commands/base.rb', line 16
def format_date(on)
Time.at(on).strftime('%d-%m-%Y')
end
|
#money_to_cents(amount) ⇒ Object
12
13
14
|
# File 'lib/xero_cli/commands/base.rb', line 12
def money_to_cents(amount)
amount / 100.0
end
|
#xero_api ⇒ Object
6
7
8
9
10
|
# File 'lib/xero_cli/commands/base.rb', line 6
def xero_api
@xero_api ||= XeroAPI.new(read_guid)
rescue StandardError
raise Exception, 'Please set XERO_CONNECTOR_URL' if ENV['XERO_CONNECTOR_URL'].empty?
end
|