Class: ThymeUbuntuNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/thyme_ubuntu_notification.rb,
lib/thyme_ubuntu_notification/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ThymeUbuntuNotification.



6
7
8
9
# File 'lib/thyme_ubuntu_notification.rb', line 6

def initialize(thyme, options={})
  @end_text   = options.fetch(:end_text,   'Pomodoro Ended')
  @start_text = options.fetch(:start_text, 'Pomodoro Started')
end

Instance Attribute Details

#end_textObject (readonly)

Returns the value of attribute end_text.



4
5
6
# File 'lib/thyme_ubuntu_notification.rb', line 4

def end_text
  @end_text
end

#start_textObject (readonly)

Returns the value of attribute start_text.



4
5
6
# File 'lib/thyme_ubuntu_notification.rb', line 4

def start_text
  @start_text
end

Instance Method Details

#after(seconds_left) ⇒ Object



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

def after(seconds_left)
  system('notify-send', end_text)
end

#beforeObject



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

def before
  system('notify-send', start_text)
end