Class: RemindMeTo::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/remindmeto/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Runner

Returns a new instance of Runner.



3
4
5
6
7
# File 'lib/remindmeto/runner.rb', line 3

def initialize(options)
  @options = options
  @notifier = Notifier.new
  @running = true
end

Instance Method Details

#runObject

The main run loop for displaying the notifications



10
11
12
13
14
15
16
# File 'lib/remindmeto/runner.rb', line 10

def run
  while(@running)
    sleep(@options[:interval])
    @notifier.notify(@options[:message], {})
    @running = false unless @options[:repeat]
  end
end