Class: Fusuma::Device
- Inherits:
-
Object
- Object
- Fusuma::Device
- Defined in:
- lib/fusuma/device.rb
Overview
detect input device
Class Attribute Summary collapse
Class Method Summary collapse
Class Attribute Details
.names ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/fusuma/device.rb', line 7 def names return @names unless no_name? device_names = fetch_device_names MultiLogger.debug(device_names: device_names) raise 'Touchpad is not found' if device_names.empty? @names = device_names rescue RuntimeError => ex MultiLogger.error(ex.) exit 1 end |
Class Method Details
.given_device=(name) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/fusuma/device.rb', line 19 def given_device=(name) return if name.nil? if names.include? name self.names = [name] return end MultiLogger.error("Device #{name} is not found") exit 1 end |