Class: Revdev::InputId
- Inherits:
-
Object
- Object
- Revdev::InputId
- Includes:
- EachValuesEqual
- Defined in:
- lib/revdev/input_id.rb,
lib/revdev.rb
Overview
wraper of "struct input_id" on "input.h"
Instance Attribute Summary collapse
-
#bustype ⇒ Object
Returns the value of attribute bustype.
-
#product ⇒ Object
Returns the value of attribute product.
-
#vendor ⇒ Object
Returns the value of attribute vendor.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(arg = nil, vendor = nil, product = nil, version = nil) ⇒ InputId
constructor
A new instance of InputId.
Methods included from EachValuesEqual
Constructor Details
#initialize(arg = nil, vendor = nil, product = nil, version = nil) ⇒ InputId
Returns a new instance of InputId.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/revdev/input_id.rb', line 10 def initialize(arg=nil, vendor=nil, product=nil, version=nil) if arg.kind_of? String raw_initialize arg elsif arg.kind_of? Hash [:bustype, :vendor, :product, :version].each do |iv| instance_variable_set("@#{iv}", arg[iv] || arg[iv.to_s]) end else @bustype = arg @vendor = vendor @product = product @version = version end end |
Instance Attribute Details
#bustype ⇒ Object
Returns the value of attribute bustype.
8 9 10 |
# File 'lib/revdev/input_id.rb', line 8 def bustype @bustype end |
#product ⇒ Object
Returns the value of attribute product.
8 9 10 |
# File 'lib/revdev/input_id.rb', line 8 def product @product end |
#vendor ⇒ Object
Returns the value of attribute vendor.
8 9 10 |
# File 'lib/revdev/input_id.rb', line 8 def vendor @vendor end |
#version ⇒ Object
Returns the value of attribute version.
8 9 10 |
# File 'lib/revdev/input_id.rb', line 8 def version @version end |