class XeroCLI::Commands::Base
Public Instance Methods
format_date(on)
click to toggle source
# 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)
click to toggle source
# File lib/xero_cli/commands/base.rb, line 12 def money_to_cents(amount) amount / 100.0 end
read_guid()
click to toggle source
# File lib/xero_cli/commands/base.rb, line 2 def read_guid @read_guid ||= XeroCLI::Credentials.read_guid end
xero_api()
click to toggle source
# 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