Class: USB::Interface

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

Instance Method Summary collapse

Constructor Details

#initialize(i) ⇒ Interface

Returns a new instance of Interface.



227
228
229
# File 'lib/libusb/compat.rb', line 227

def initialize(i)
  @i = i
end

Instance Method Details

#<=>(o) ⇒ Object



233
234
235
# File 'lib/libusb/compat.rb', line 233

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

#busObject



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

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

#configurationObject



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

def configuration; Configuration.new(@i.configuration); end

#deviceObject



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

def device() self.configuration.device end

#endpointsObject



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

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

#settingsObject



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

def settings; @i.alt_settings.map{|c| Setting.new(c) }; end