Class: USB::Configuration

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

Instance Method Summary collapse

Constructor Details

#initialize(cd) ⇒ Configuration

Returns a new instance of Configuration.


204
205
206
# File 'lib/libusb/compat.rb', line 204

def initialize(cd)
  @cd = cd
end

Instance Method Details

#<=>(o) ⇒ Object


212
213
214
# File 'lib/libusb/compat.rb', line 212

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

#busObject


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

def bus; default_bus; end

#deviceObject


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

def device() Device.new(@cd.device) end

#endpointsObject


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

def endpoints() self.settings.map {|d| d.endpoints }.flatten end

#interfacesObject


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

def interfaces; @cd.interfaces.map{|c| Interface.new(c) }; end

#settingsObject


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

def settings() self.interfaces.map {|d| d.settings }.flatten end