Module: Hearken::Command

Included in:
Enqueue, Flush, List, Recent, Reload, Restart, Scrobbling, Search, SetupScrobbling, Shuffle, Start, Status, Stop
Defined in:
lib/hearken/command.rb

Defined Under Namespace

Modules: ClassMethods Classes: Enqueue, Flush, List, Recent, Reload, Restart, Scrobbling, Search, SetupScrobbling, Shuffle, Start, Status, Stop

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#helpObject (readonly)

Returns the value of attribute help.



3
4
5
# File 'lib/hearken/command.rb', line 3

def help
  @help
end

#usageObject (readonly)

Returns the value of attribute usage.



3
4
5
# File 'lib/hearken/command.rb', line 3

def usage
  @usage
end

Class Method Details

.included(cls) ⇒ Object



5
6
7
# File 'lib/hearken/command.rb', line 5

def self.included cls
  cls.extend ClassMethods
end

.load(name, *args) ⇒ Object



9
10
11
12
13
# File 'lib/hearken/command.rb', line 9

def self.load name, *args
  require "hearken/command/#{name}"
  classname = name.to_s.split('_').map{|s|s.capitalize}.join
  Hearken::Command.const_get(classname).new *args
end

Instance Method Details

#initialize(player) ⇒ Object



15
16
17
18
19
# File 'lib/hearken/command.rb', line 15

def initialize player
  @player = player
  @usage = ''
  @help = ''
end