Class: RubDev::Monitor
- Inherits:
-
Object
- Object
- RubDev::Monitor
- Defined in:
- lib/rubdev/monitor.rb
Class Method Summary collapse
Instance Method Summary collapse
- #buffer_size=(size) ⇒ Object
- #context ⇒ Object
- #enable_receiving ⇒ Object
- #fd ⇒ Object
- #filter_add_match_subsystem_devtype(subsystem, devtype = nil) ⇒ Object
- #filter_add_match_tag(tag) ⇒ Object
- #filter_remove ⇒ Object
- #filter_update ⇒ Object
- #receive_device ⇒ Object
- #ref ⇒ Object
- #to_io ⇒ Object
- #unref ⇒ Object
Class Method Details
Instance Method Details
#buffer_size=(size) ⇒ Object
62 63 64 65 |
# File 'lib/rubdev/monitor.rb', line 62 def buffer_size= (size) return false unless size.is_a?(Integer) RubDev::C.udev_monitor_set_receive_buffer_size(@pointer, size) end |
#context ⇒ Object
36 37 38 39 40 |
# File 'lib/rubdev/monitor.rb', line 36 def context Context.allocate.tap {|i| i.instance_variable_set(:@pointer, RubDev::C.udev_monitor_get_udev(@pointer)) } end |
#enable_receiving ⇒ Object
58 59 60 |
# File 'lib/rubdev/monitor.rb', line 58 def enable_receiving RubDev::C.udev_monitor_enable_receiving(@pointer) end |
#fd ⇒ Object
67 68 69 |
# File 'lib/rubdev/monitor.rb', line 67 def fd RubDev::C.udev_monitor_get_fd(@pointer) end |
#filter_add_match_subsystem_devtype(subsystem, devtype = nil) ⇒ Object
77 78 79 |
# File 'lib/rubdev/monitor.rb', line 77 def filter_add_match_subsystem_devtype (subsystem, devtype=nil) RubDev::C.udev_monitor_filter_add_match_subsystem_devtype(@pointer, subsystem, devtype) end |
#filter_add_match_tag(tag) ⇒ Object
81 82 83 |
# File 'lib/rubdev/monitor.rb', line 81 def filter_add_match_tag (tag) RubDev::C.udev_monitor_filter_add_match_tag(@pointer, tag) end |
#filter_remove ⇒ Object
89 90 91 |
# File 'lib/rubdev/monitor.rb', line 89 def filter_remove RubDev::C.udev_monitor_filter_remove(@pointer) end |
#filter_update ⇒ Object
85 86 87 |
# File 'lib/rubdev/monitor.rb', line 85 def filter_update RubDev::C.udev_monitor_filter_update(@pointer) end |
#receive_device ⇒ Object
71 72 73 74 75 |
# File 'lib/rubdev/monitor.rb', line 71 def receive_device Device.allocate.tap {|i| i.instance_variable_set(:@pointer, RubDev::C.udev_monitor_receive_device(@pointer)) } end |
#ref ⇒ Object
26 27 28 29 |
# File 'lib/rubdev/monitor.rb', line 26 def ref RubDev::C.udev_monitor_ref(@pointer) self end |
#to_io ⇒ Object
93 94 95 |
# File 'lib/rubdev/monitor.rb', line 93 def to_io IO.for_fd(fd) end |