Class: AudioAddict::Commands::SetCmd

Inherits:
Base
  • Object
show all
Defined in:
lib/audio_addict/commands/set.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



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/audio_addict/commands/set.rb', line 20

def run(args)
  channel = args['CHANNEL']
  network = args['NETWORK']

  full_set = (channel and network) || !(channel or network)

  if full_set
    set_both channel, network
  else
    set_channel channel
  end
end