Class: AudioAddict::Commands::ChannelsCmd

Inherits:
Base
  • Object
show all
Defined in:
lib/audio_addict/commands/channels.rb

Instance Method Summary collapse

Methods inherited from Base

#current_channel, #current_network, #needs, #prompt, #radio, #require_premium_account

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/audio_addict/commands/channels.rb', line 20

def run
  needs :network

  say "gu`#{radio.name}`\n"

  search = args['SEARCH']

  channels = search ? radio.search(search) : radio.channels

  channels = channels.values
  if args['--info']
    show_verbose channels
  else
    show_compact channels
  end
end