Sha256: 6c34adef3ba5f7fe09a7af07718afca9af937205b01106252ae7d7c47fd49791

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

require 'ADB'

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

class GetValuesInteractor

  include Log
  include ADB

  def initialize(stf)
    @stf = stf
  end

  def execute(key)
    devices = @stf.get_devices

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

    return devices
             .map {|d| Device.new(d)}
             .map {|d| d.getValue(key)}
             .uniq
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

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