Sha256: a70b5f35948c8d92b628315782f0a4ec3eeee48083f4a11dda4cb167f32a022e

Contents?: true

Size: 551 Bytes

Versions: 14

Compression:

Stored size: 551 Bytes

Contents

require 'ADB'
require 'di'

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

module Stf
  class GetKeysInteractor
    include Log
    include ADB

    def execute
      devices = DI[:stf].get_devices

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
stf-client-0.3.0.rc8 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc7 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc6 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc5 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc4 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc3 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc2 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.6 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.5 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.4 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.3 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.2 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.1 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.2.0 lib/stf/interactor/get_keys_interactor.rb