Class: ThymePluginMusic
- Inherits:
-
Object
- Object
- ThymePluginMusic
- Defined in:
- lib/thyme_verbose/plugin_music.rb
Instance Method Summary collapse
- #after(seconds_left) ⇒ Object
-
#before ⇒ Object
Hooks.
-
#initialize(thyme, options = {}) ⇒ ThymePluginMusic
constructor
A new instance of ThymePluginMusic.
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, ={}) @player = [:player] || 'spotify' @command_play = [:command_play] || command_play @command_pause = [: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 |