Class: Twurl::AccountInformationController
- Inherits:
-
AbstractCommandController
- Object
- AbstractCommandController
- Twurl::AccountInformationController
- Defined in:
- lib/twurl/account_information_controller.rb
Constant Summary collapse
- NO_AUTHORIZED_ACCOUNTS_MESSAGE =
"No authorized accounts"
Instance Attribute Summary
Attributes inherited from AbstractCommandController
Instance Method Summary collapse
Methods inherited from AbstractCommandController
Constructor Details
This class inherits a constructor from Twurl::AbstractCommandController
Instance Method Details
#dispatch ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/twurl/account_information_controller.rb', line 5 def dispatch rcfile = OAuthClient.rcfile if rcfile.empty? CLI.puts NO_AUTHORIZED_ACCOUNTS_MESSAGE else profiles = rcfile.profiles profiles.keys.sort.each do |account_name| CLI.puts account_name profiles[account_name].each do |consumer_key, _| account_summary = " #{consumer_key}" account_summary << " (default)" if rcfile.default_profile == [account_name, consumer_key] CLI.puts account_summary end end end end |