Class: StopAllDebugSessionsInteractor

Inherits:
Object
  • Object
show all
Includes:
ADB, Log
Defined in:
lib/stf/interactor/stop_all_debug_sessions_interactor.rb

Instance Method Summary collapse

Methods included from Log

#logger, verbose

Constructor Details

#initialize(stf) ⇒ StopAllDebugSessionsInteractor

Returns a new instance of StopAllDebugSessionsInteractor.



12
13
14
# File 'lib/stf/interactor/stop_all_debug_sessions_interactor.rb', line 12

def initialize(stf)
  @stf = stf
end

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
24
# File 'lib/stf/interactor/stop_all_debug_sessions_interactor.rb', line 16

def execute
  connected_devices = devices()
  remote_devices    = @stf.get_user_devices.map { |d| d.remoteConnectUrl }

  pending_disconnect = connected_devices & remote_devices
  pending_disconnect.each do |d|
    StopDebugSessionInteractor.new(@stf).execute d
  end
end