Class: ThymePluginMusic

Inherits:
Object
  • Object
show all
Defined in:
lib/thyme_verbose/plugin_music.rb

Instance Method Summary collapse

Constructor Details

#initialize(thyme, options = {}) ⇒ ThymePluginMusic

Returns a new instance of ThymePluginMusic.



3
4
5
6
7
8
9
10
11
12
# File 'lib/thyme_verbose/plugin_music.rb', line 3

def initialize(thyme, options={})
  @player = options[:player] || 'spotify'
  @command_play = options[:command_play] || command_play
  @command_pause = options[:command_pause] || command_pause
  mute_music = @mute_music = false
  thyme.option :m, nil, 'disalbe music plugin for this Pomodoro' do
      mute_music.replace true
      @run = true
  end
end

Instance Method Details

#after(seconds_left) ⇒ Object



20
21
22
# File 'lib/thyme_verbose/plugin_music.rb', line 20

def after(seconds_left)
  `#{@command_pause}` unless @break || @mute_music
end

#before ⇒ Object

Hooks



16
17
18
# File 'lib/thyme_verbose/plugin_music.rb', line 16

def before
  `#{@command_play}` unless @break || @mute_music
end