Class: GetKeysInteractor
- Inherits:
-
Object
- Object
- GetKeysInteractor
- Includes:
- ADB, Log
- Defined in:
- lib/stf/interactor/get_keys_interactor.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(stf) ⇒ GetKeysInteractor
constructor
A new instance of GetKeysInteractor.
Methods included from Log
Constructor Details
#initialize(stf) ⇒ GetKeysInteractor
Returns a new instance of GetKeysInteractor.
14 15 16 |
# File 'lib/stf/interactor/get_keys_interactor.rb', line 14 def initialize(stf) @stf = stf end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/stf/interactor/get_keys_interactor.rb', line 18 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 |