Class: AutomationObject::State::ChangeToPreviousScreen

Inherits:
ActionLoop
  • Object
show all
Defined in:
lib/automation_object/state/hook_actions/change_to_previous_screen.rb

Overview

Change to previous screen hook loop

Instance Attribute Summary

Attributes inherited from ActionLoop

#blue_prints, #composite, #driver, #loops

Instance Method Summary collapse

Methods inherited from ActionLoop

#initialize, #run

Constructor Details

This class inherits a constructor from AutomationObject::State::ActionLoop

Instance Method Details

#single_runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/automation_object/state/hook_actions/change_to_previous_screen.rb', line 9

def single_run
  return false unless driver.document_complete?

  new_screen = composite.top.screens[composite.screen.previous_screen_name]
  # Need strict check, can be nil
  return false if new_screen.load.live? == false

  new_screen.previous_screen_name = composite.screen.name
  composite.screen.deactivate
  new_screen.activate

  true
end