lib/tamashii/agent/buzzer.rb in tamashii-agent-0.1.11 vs lib/tamashii/agent/buzzer.rb in tamashii-agent-0.2.0
- old
+ new
@@ -1,6 +1,7 @@
require 'tamashii/agent/component'
+require 'tamashii/agent/event'
require 'tamashii/agent/adapter/buzzer'
module Tamashii
module Agent
class Buzzer < Component
@@ -8,14 +9,14 @@
super
@buzzer = Adapter::Buzzer.object
logger.debug "Using buzzer instance: #{@buzzer.class}"
end
- def process_event(ev_type, ev_body)
- case ev_type
- when EVENT_BEEP
- logger.debug "Beep: #{ev_body}"
- case ev_body
+ def process_event(event)
+ case event.type
+ when Event::BEEP
+ logger.debug "Beep: #{event.body}"
+ case event.body
when "ok"
@buzzer.play_ok
when "no"
@buzzer.play_no
when "error"