Class: USB::Setting

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Comparable
Defined in:
lib/libusb/compat.rb

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Setting

Returns a new instance of Setting.


248
249
250
# File 'lib/libusb/compat.rb', line 248

def initialize(id)
  @id = id
end

Instance Method Details

#<=>(o) ⇒ Object


256
257
258
# File 'lib/libusb/compat.rb', line 256

def <=>(o)
  @id<=>o.instance_variable_get(:@id)
end

#busObject


260
# File 'lib/libusb/compat.rb', line 260

def bus() self.interface.configuration.device.bus end

#configurationObject


262
# File 'lib/libusb/compat.rb', line 262

def configuration() self.interface.configuration end

#deviceObject


261
# File 'lib/libusb/compat.rb', line 261

def device() self.interface.configuration.device end

#endpointsObject


264
# File 'lib/libusb/compat.rb', line 264

def endpoints() @id.endpoints.map {|d| Endpoint.new(d) }.flatten end

#interfaceObject


263
# File 'lib/libusb/compat.rb', line 263

def interface; Interface.new(@id.interface); end