Class: Message
- Inherits:
-
Object
- Object
- Message
- Defined in:
- lib/tell_me.rb
Overview
— CLASSES —
Instance Method Summary collapse
-
#initialize(content, date) ⇒ Message
constructor
A new instance of Message.
- #notify ⇒ Object
- #schedule ⇒ Object
Constructor Details
#initialize(content, date) ⇒ Message
Returns a new instance of Message.
13 14 15 16 17 |
# File 'lib/tell_me.rb', line 13 def initialize(content, date) @content = content @date = date @scheduler = Rufus::Scheduler.new end |
Instance Method Details
#notify ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/tell_me.rb', line 27 def notify Notifier.notify( title: 'Hey', message: @content, sound: 'default' ) @scheduler.shutdown end |
#schedule ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/tell_me.rb', line 19 def schedule date = @date.strftime "%Y/%m/%d %H:%M" @scheduler.at date do notify end @scheduler.join end |