Class: USB::Configuration
- Inherits:
-
Object
- Object
- USB::Configuration
- Extended by:
- Forwardable
- Includes:
- Comparable
- Defined in:
- lib/libusb/compat.rb
Instance Method Summary collapse
- #<=>(o) ⇒ Object
- #bus ⇒ Object
- #device ⇒ Object
- #endpoints ⇒ Object
-
#initialize(cd) ⇒ Configuration
constructor
A new instance of Configuration.
- #interfaces ⇒ Object
- #settings ⇒ Object
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 |
#bus ⇒ Object
216 |
# File 'lib/libusb/compat.rb', line 216 def bus; default_bus; end |
#device ⇒ Object
217 |
# File 'lib/libusb/compat.rb', line 217 def device() Device.new(@cd.device) end |
#endpoints ⇒ Object
220 |
# File 'lib/libusb/compat.rb', line 220 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#interfaces ⇒ Object
218 |
# File 'lib/libusb/compat.rb', line 218 def interfaces; @cd.interfaces.map{|c| Interface.new(c) }; end |
#settings ⇒ Object
219 |
# File 'lib/libusb/compat.rb', line 219 def settings() self.interfaces.map {|d| d.settings }.flatten end |