Class: AutomationObject::State::ActionLoop
- Inherits:
-
Object
- Object
- AutomationObject::State::ActionLoop
- Defined in:
- lib/automation_object/state/hook_actions/action_loop.rb
Overview
Composite action loop base class
Direct Known Subclasses
ChangeScreen, ChangeToPreviousScreen, CloseModal, CloseScreen, ElementRequirement, NewScreen, PossibleScreenChanges, ResetScreen, ShowModal, Sleep, WaitForElements
Instance Attribute Summary collapse
- #blue_prints ⇒ AutomationObject::BluePrint::Composite::Base
- #composite ⇒ AutomationObject::State::Base
- #driver ⇒ AutomationObject::Driver::Driver
- #loops ⇒ Integer
Instance Method Summary collapse
-
#initialize(composite, driver, blue_prints, loops = 30) ⇒ ActionLoop
constructor
A new instance of ActionLoop.
-
#run ⇒ Boolean
Run success or not.
-
#single_run ⇒ Boolean
Abstract method, override.
Constructor Details
#initialize(composite, driver, blue_prints, loops = 30) ⇒ ActionLoop
Returns a new instance of ActionLoop
20 21 22 23 24 25 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 20 def initialize(composite, driver, blue_prints, loops = 30) self.composite = composite self.driver = driver self.blue_prints = blue_prints self.loops = loops end |
Instance Attribute Details
#blue_prints ⇒ AutomationObject::BluePrint::Composite::Base
12 13 14 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 12 def blue_prints @blue_prints end |
#composite ⇒ AutomationObject::State::Base
8 9 10 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 8 def composite @composite end |
#driver ⇒ AutomationObject::Driver::Driver
10 11 12 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 10 def driver @driver end |
#loops ⇒ Integer
14 15 16 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 14 def loops @loops end |
Instance Method Details
#run ⇒ Boolean
Returns run success or not
28 29 30 31 32 33 34 35 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 28 def run loops.times do # Sub classes implement single run return true if single_run end false end |
#single_run ⇒ Boolean
Abstract method, override
39 40 41 |
# File 'lib/automation_object/state/hook_actions/action_loop.rb', line 39 def single_run raise NotImplementedError end |