Class: USB::Device
- Inherits:
-
Object
- Object
- USB::Device
- Extended by:
- Forwardable
- Includes:
- Comparable
- Defined in:
- lib/libusb/compat.rb
Instance Method Summary (collapse)
- - (Object) <=>(o)
- - (Object) bus
- - (Object) configurations
- - (Object) endpoints
-
- (Device) initialize(dev)
constructor
A new instance of Device.
- - (Object) interfaces
- - (Object) open
- - (Object) settings
Constructor Details
- (Device) initialize(dev)
A new instance of Device
166 167 168 |
# File 'lib/libusb/compat.rb', line 166 def initialize(dev) @dev = dev end |
Instance Method Details
- (Object) <=>(o)
176 177 178 |
# File 'lib/libusb/compat.rb', line 176 def <=>(o) @dev<=>o.instance_variable_get(:@dev) end |
- (Object) bus
193 |
# File 'lib/libusb/compat.rb', line 193 def bus; default_bus; end |
- (Object) configurations
194 |
# File 'lib/libusb/compat.rb', line 194 def configurations; @dev.configurations.map{|c| Configuration.new(c) }; end |
- (Object) endpoints
197 |
# File 'lib/libusb/compat.rb', line 197 def endpoints; @dev.endpoints.map{|c| Endpoint.new(c) }; end |
- (Object) interfaces
195 |
# File 'lib/libusb/compat.rb', line 195 def interfaces; @dev.interfaces.map{|c| Interface.new(c) }; end |
- (Object) open
180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/libusb/compat.rb', line 180 def open h = DevHandle.new(@dev.open) if block_given? begin yield h ensure h.usb_close end else h end end |
- (Object) settings
196 |
# File 'lib/libusb/compat.rb', line 196 def settings; @dev.settings.map{|c| Setting.new(c) }; end |