Class: Spty::Command::StateCommand

Inherits:
BaseCommand show all
Defined in:
lib/spty/commands/state_command.rb

Constant Summary collapse

ASCRIPT_PLAYER_STATE =

Display the current state of the player.

<<-EOL
  tell application "Spotify" to return player state
EOL

Constants inherited from BaseCommand

BaseCommand::ASCRIPT_PLAYER_DETECT

Class Method Summary collapse

Methods inherited from BaseCommand

running?

Class Method Details

.call(_, _command = nil) ⇒ Object



7
8
9
10
11
12
# File 'lib/spty/commands/state_command.rb', line 7

def self.call(_, _command = nil)
  return unless running?

  player_state = Spty::AppleScriptRunner.(ASCRIPT_PLAYER_STATE)
  puts "=> player #{player_state}"
end