Class: XeroCLI::Commands::Transfer

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

Constant Summary collapse

TRANSACTION_TYPE =
'RECEIVE'.freeze

Instance Method Summary collapse

Methods inherited from Base

#format_date, #money_to_cents, #read_guid, #xero_api

Constructor Details

#initialize(options) ⇒ Transfer

Returns a new instance of Transfer.



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

def initialize(options)
  @transfer = options.transfer
  @to = options.to
  @from = options.from
  @on = options.on
end

Instance Method Details

#performObject



11
12
13
14
15
16
# File 'lib/xero_cli/commands/transfer.rb', line 11

def perform
  check_exceptions
  transfer_attributes = XeroCLI::Templates::Transfer.attributes(transfer, from, to, on)
  create_transfer(transfer_attributes)
  write_to_terminal
end