Sha256: 079294a791f83a51e2380502f1145a0f8761854be3ba49d02e23db9a21f83847

Contents?: true

Size: 561 Bytes

Versions: 4

Compression:

Stored size: 561 Bytes

Contents

require 'ADB'

require 'stf/client'
require 'stf/log/log'
require 'stf/errors'
require 'stf/model/session'
require 'stf/model/device'

class GetKeysInteractor

  include Log
  include ADB

  def initialize(stf)
    @stf = stf
  end

  def execute
    devices = @stf.get_devices

    if devices.nil? || (devices.is_a?(Array) && devices.empty?)
      logger.info 'No devices connected to STF'
      return []
    end

    return devices
             .map {|d| Device.new(d)}
             .flat_map {|d| d.getKeys }
             .uniq
             .sort
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
stf-client-neofreko-0.1.9 lib/stf/interactor/get_keys_interactor.rb
stf-client-neofreko-0.1.8 lib/stf/interactor/get_keys_interactor.rb
stf-client-neofreko-0.1.7 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.1.6 lib/stf/interactor/get_keys_interactor.rb