Class: USB::Bus
- Inherits:
-
Object
- Object
- USB::Bus
- Defined in:
- lib/usb.rb
Instance Method Summary collapse
- #configurations ⇒ Object
- #devices ⇒ Object
- #endpoints ⇒ Object
- #find_device(n) ⇒ Object
- #inspect ⇒ Object
- #interfaces ⇒ Object
- #settings ⇒ Object
Instance Method Details
#configurations ⇒ Object
139 |
# File 'lib/usb.rb', line 139 def configurations() self.devices.map {|d| d.configurations }.flatten end |
#devices ⇒ Object
129 130 131 132 133 134 135 136 137 |
# File 'lib/usb.rb', line 129 def devices result = [] device = self.first_device while device result << device device = device.next end result.sort_by {|d| d.filename } end |
#endpoints ⇒ Object
142 |
# File 'lib/usb.rb', line 142 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#find_device(n) ⇒ Object
144 145 146 147 148 149 150 151 |
# File 'lib/usb.rb', line 144 def find_device(n) device = self.first_device while device return device if n == device.filename.to_i device = device.next end return nil end |
#inspect ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/usb.rb', line 121 def inspect if self.revoked? "\#<#{self.class} revoked>" else "\#<#{self.class} #{self.dirname}>" end end |
#interfaces ⇒ Object
140 |
# File 'lib/usb.rb', line 140 def interfaces() self.configurations.map {|d| d.interfaces }.flatten end |
#settings ⇒ Object
141 |
# File 'lib/usb.rb', line 141 def settings() self.interfaces.map {|d| d.settings }.flatten end |