Class: Kuzya::Commands::List

Inherits:
Base
  • Object
show all
Defined in:
lib/kuzya/commands/list.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

args_without_command, call

Constructor Details

#initialize(config) ⇒ List

Returns a new instance of List.



16
17
18
# File 'lib/kuzya/commands/list.rb', line 16

def initialize(config)
  @config = config
end

Class Method Details

.infoObject



5
6
7
8
9
# File 'lib/kuzya/commands/list.rb', line 5

def info
<<-INFO
#{'list'.bold} - to see all shortcuts run '#{'kuzya list'.italic}'
INFO
end

.prepare(_args, config) ⇒ Object



11
12
13
# File 'lib/kuzya/commands/list.rb', line 11

def prepare(_args, config)
  [config]
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
# File 'lib/kuzya/commands/list.rb', line 20

def call
  resolved = []
  resolve_shortcuts([], [], fetch_keys(config.shortcuts), resolved)

  resolved.each do |shortcuts|
    puts  "#{shortcuts.join(' ').bold}: #{build_url(shortcuts, config)}"
  end
end