Class: XeroCLI::Commands

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

Defined Under Namespace

Classes: Accounts, Balance, Base, Receive, Spend, Transfer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, xero) ⇒ Commands

Returns a new instance of Commands.



5
6
7
8
# File 'lib/xero_cli/commands.rb', line 5

def initialize(options, xero)
  @options = options
  @xero = xero
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#xeroObject (readonly)

Returns the value of attribute xero.



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

def xero
  @xero
end

Instance Method Details

#performObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xero_cli/commands.rb', line 10

def perform
  help          if options.help
  set_guid      if options.set_guid
  show_guid     if options.show_guid
  show_accounts if options.show_accounts
  get_guid      if options.get_guid
  spend         if options.spend
  receive       if options.receive
  transfer      if options.transfer
  balance       if options.balance
  default
end