Class: Ruby::Pomodoro::Notification
- Inherits:
-
Object
- Object
- Ruby::Pomodoro::Notification
- Defined in:
- lib/ruby/pomodoro/notification.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message, channel) ⇒ Notification
constructor
A new instance of Notification.
- #notify(repeat_at = nil, skip_now: false) ⇒ TrueClass
- #stop ⇒ TrueClass
Constructor Details
#initialize(message, channel) ⇒ Notification
Returns a new instance of Notification.
8 9 10 11 |
# File 'lib/ruby/pomodoro/notification.rb', line 8 def initialize(, channel) @message = @channel = channel end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/ruby/pomodoro/notification.rb', line 4 def @message end |
Instance Method Details
#notify(repeat_at = nil, skip_now: false) ⇒ TrueClass
16 17 18 19 20 |
# File 'lib/ruby/pomodoro/notification.rb', line 16 def notify(repeat_at = nil, skip_now: false) @channel.call() unless skip_now repeat(repeat_at) if repeat_at true end |
#stop ⇒ TrueClass
23 24 25 26 |
# File 'lib/ruby/pomodoro/notification.rb', line 23 def stop @thread&.kill true end |