Class: ArduinoBuildNotifier::Notifier

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/arduino_build_notifier/notifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(build, arduino, time = 10) ⇒ Notifier

Returns a new instance of Notifier.



7
8
9
10
11
# File 'lib/arduino_build_notifier/notifier.rb', line 7

def initialize(build, arduino, time = 10)
  @time    = time
  @build   = build
  @arduino = arduino
end

Instance Method Details

#notify(status) ⇒ Object



13
14
15
# File 'lib/arduino_build_notifier/notifier.rb', line 13

def notify(status)
  @arduino.send status
end

#start_notificationsObject



17
18
19
20
21
# File 'lib/arduino_build_notifier/notifier.rb', line 17

def start_notifications
  every @time do
    notify @build.request_status
  end
end