class AdbSdkLib::DeviceList

List of devices. It can be used as Enumerable like Set, and as Hash which key

is the serial number of the device.

Public Class Methods

new(devices = []) click to toggle source

@param [Enumerable] devices Device object of Java

# File lib/adb-sdklib.rb, line 13
def initialize(devices = [])
  devices.each { |d| self[d.serial_number] = d }
end

Public Instance Methods

each() { |device| ... } click to toggle source

Calls block once for each device in self, passing that device as a parameter. If no block is given, an enumerator is returned instead. @return [Enumerator] if not block given @return [self] if block given @yield [device] called with each device @yieldparam [Device] device a device instance

# File lib/adb-sdklib.rb, line 22
def each
  return self.values.each unless block_given?
  self.values.each {|device| yield device }
  return self
end