Class: USB::Bus
- Inherits:
-
Object
- Object
- USB::Bus
- Defined in:
- lib/libusb/compat.rb
Instance Method Summary collapse
- #configurations ⇒ Object
- #devices ⇒ Object
- #endpoints ⇒ Object
- #find_device(n) ⇒ Object
-
#initialize(context) ⇒ Bus
constructor
A new instance of Bus.
- #interfaces ⇒ Object
- #settings ⇒ Object
Constructor Details
#initialize(context) ⇒ Bus
Returns a new instance of Bus.
141 142 143 |
# File 'lib/libusb/compat.rb', line 141 def initialize(context) @ct = context end |
Instance Method Details
#configurations ⇒ Object
148 |
# File 'lib/libusb/compat.rb', line 148 def configurations() self.devices.map{|d| d.configurations }.flatten end |
#devices ⇒ Object
144 145 146 |
# File 'lib/libusb/compat.rb', line 144 def devices @ct.devices.map{|d| Device.new(d) } end |
#endpoints ⇒ Object
151 |
# File 'lib/libusb/compat.rb', line 151 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#find_device(n) ⇒ Object
153 154 155 |
# File 'lib/libusb/compat.rb', line 153 def find_device(n) raise NotImplementedError end |
#interfaces ⇒ Object
149 |
# File 'lib/libusb/compat.rb', line 149 def interfaces() self.configurations.map {|d| d.interfaces }.flatten end |
#settings ⇒ Object
150 |
# File 'lib/libusb/compat.rb', line 150 def settings() self.interfaces.map {|d| d.settings }.flatten end |