Class: EYCli::Command::Accounts

Inherits:
Base
  • Object
show all
Defined in:
lib/ey_cli/commands/accounts.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#options_parser, #run

Constructor Details

#initializeAccounts

Returns a new instance of Accounts.



4
5
6
# File 'lib/ey_cli/commands/accounts.rb', line 4

def initialize
  @accounts = EYCli::Controller::Accounts.new
end

Instance Method Details

#helpObject



18
19
20
21
22
23
# File 'lib/ey_cli/commands/accounts.rb', line 18

def help
  "Usage: ey_cli accounts\nNote: it shows the accounts that belong to you and also the ones that you are collaborating with.\n"
end

#invokeObject



8
9
10
11
12
13
14
15
16
# File 'lib/ey_cli/commands/accounts.rb', line 8

def invoke
  accounts = @accounts.fetch_accounts.map {|a| "  - #{a.name}"}.join("\n")
  EYCli.term.say "\nAvailable accounts:\n\#{accounts}\n"

end