Class: Vigilem::Evdev::Stat
- Inherits:
-
Core::Stat
- Object
- Core::Stat
- Vigilem::Evdev::Stat
- Defined in:
- lib/vigilem/evdev/stat.rb
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(gem_name = 'vigilem-evdev', opts = {}, &api_check) ⇒ Stat
constructor
A new instance of Stat.
Constructor Details
#initialize(gem_name = 'vigilem-evdev', opts = {}, &api_check) ⇒ Stat
Returns a new instance of Stat.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/vigilem/evdev/stat.rb', line 10 def initialize(gem_name='vigilem-evdev', opts={}, &api_check) system_name = 'evdev' opts[:path] ||= event_dir if block_given? super(system_name, gem_name, opts, &api_check) else super(system_name, gem_name, opts) do Dir.exists?(opts[:path]) and Dir["#{opts[:path]}#{File::SEPARATOR}event*"].any? end end end |
Instance Attribute Details
#event_dir ⇒ String
24 25 26 |
# File 'lib/vigilem/evdev/stat.rb', line 24 def event_dir @event_path ||= "#{File::SEPARATOR}#{File.join(%w(dev input))}" end |