Sha256: b0f432a9c5e854f099156583cff64e5fd55f093f5d26462f1d61235de9f8c4b2

Contents?: true

Size: 502 Bytes

Versions: 6

Compression:

Stored size: 502 Bytes

Contents

require 'ADB'
require 'di'

require 'stf/client'
require 'stf/log/log'
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

6 entries across 6 versions & 2 rubygems

Version Path
smartdust-client-1.2.0 lib/stf/interactor/get_keys_interactor.rb
smartdust-client-1.1.0 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.pre.rc.12 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc10 lib/stf/interactor/get_keys_interactor.rb
stf-client-0.3.0.rc9 lib/stf/interactor/get_keys_interactor.rb