class FSEvent::AbstractDevice
Abstract class for devices
Attributes
framework[W]
name[R]
schedule[R]
Private Class Methods
new(device_name)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 21 def initialize(device_name) @name = device_name @current_status = {} @schedule = FSEvent::ScheduleMerger.new end
Public Instance Methods
add_watch(watchee_device_name_pat, status_name_pat, reaction = :immediate)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 60 def add_watch(watchee_device_name_pat, status_name_pat, reaction = :immediate) @framework.add_watch(watchee_device_name_pat, status_name_pat, reaction) end
define_status(status_name, value)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 68 def define_status(status_name, value) @framework.define_status(status_name, value) end
del_watch(watchee_device_name_pat, status_name_pat)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 64 def del_watch(watchee_device_name_pat, status_name_pat) @framework.del_watch(watchee_device_name_pat, status_name_pat) end
inspect()
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 29 def inspect "\#<#{self.class}: #{@name}>" end
modify_status(status_name, value)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 72 def modify_status(status_name, value) @framework.modify_status(status_name, value) end
register_device(device)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 80 def register_device(device) @framework.register_device(device) end
registered()
click to toggle source
Called from the framework when this device is registered.
# File lib/fsevent/abstractdevice.rb, line 34 def registered # child process calls: # * add_watch # * del_watch # possible but needless # * define_status # * modify_status # possible but needless # * undefine_status # possible but needless # * set_elapsed_time end
run(watched_status, changed_status)
click to toggle source
Called from the framework
# File lib/fsevent/abstractdevice.rb, line 49 def run(watched_status, changed_status) raise NotImplementedError # child process calls: # * add_watch # possible but should be rare # * del_watch # * define_status # possible but should be rare # * modify_status # * undefine_status # * set_elapsed_time end
set_elapsed_time(t)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 88 def set_elapsed_time(t) @framework.set_elapsed_time(t) end
undefine_status(status_name)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 76 def undefine_status(status_name) @framework.undefine_status(status_name) end
unregister_device(device_name)
click to toggle source
# File lib/fsevent/abstractdevice.rb, line 84 def unregister_device(device_name) @framework.unregister_device(device_name) end
unregistered()
click to toggle source
Called from the framework when this device is unregistered.
# File lib/fsevent/abstractdevice.rb, line 45 def unregistered end