Class: Candelabra::Pianobar::Execute

Inherits:
Object
  • Object
show all
Defined in:
lib/candelabra/pianobar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExecute

Returns a new instance of Execute.



93
94
95
96
97
98
99
# File 'lib/candelabra/pianobar.rb', line 93

def initialize
  @commands = {
    :start    => Start.new,
    :stop_all => StopAll.new,
    :pid      => PID.new
  }
end

Instance Attribute Details

#commandsObject

Returns the value of attribute commands.



91
92
93
# File 'lib/candelabra/pianobar.rb', line 91

def commands
  @commands
end

Instance Method Details

#command(command) ⇒ Object



101
102
103
104
# File 'lib/candelabra/pianobar.rb', line 101

def command(command)
  Remote.flush_all
  @commands[command].go if @commands[command]
end