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

#run(args) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/audio_addict/commands/channels.rb', line 16

def run(args)
  needs :network

  say "!undgrn!#{radio.name}\n"

  search = args['SEARCH']

  channels = search ? radio.search(search) : radio.channels
  
  channels = channels.values
  channels.each do |channel|
    say "!txtgrn!#{channel.key.rjust 25} !txtblu!#{channel.name.strip}"
  end
end