Sha256: 49bf0dd673b340fb7958b20967e0e04a63af74ebc54863b30d810bde54287457
Contents?: true
Size: 746 Bytes
Versions: 7
Compression:
Stored size: 746 Bytes
Contents
require 'tamashii/agent/component' require 'tamashii/agent/event' require 'tamashii/agent/adapter/buzzer' module Tamashii module Agent class Buzzer < Component def initialize(master) super @buzzer = Adapter::Buzzer.object logger.debug "Using buzzer instance: #{@buzzer.class}" end 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" @buzzer.play_error end end end def clean_up super @buzzer.stop end end end end
Version data entries
7 entries across 7 versions & 1 rubygems