Class: Commands::Skip

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/skip.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, settings) ⇒ Skip

Returns a new instance of Skip.



3
4
5
# File 'lib/commands/skip.rb', line 3

def initialize(args, settings)
  @app = args.first || settings.get('default_player')
end

Class Method Details

.matchesObject



19
20
21
# File 'lib/commands/skip.rb', line 19

def self.matches
  ['skip', 'skip this song', 'next', 'next song']
end

Instance Method Details

#goObject



7
8
9
# File 'lib/commands/skip.rb', line 7

def go
  `osascript -e 'tell application "#{@app}" to next track'`
end

#media?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/commands/skip.rb', line 15

def media?
  false
end

#respondObject



11
12
13
# File 'lib/commands/skip.rb', line 11

def respond
  "Now playing: #{`osascript -e 'tell application "#{@app}" to get the name of the current track'`}".chomp rescue ""
end