Class: AutomationObject::BluePrint::PageObjectAdapter::HockAction
- Defined in:
- lib/automation_object/blue_print/page_object_adapter/hook_action.rb
Overview
HockAction composite
Instance Attribute Summary
Attributes inherited from Composite
#constant, #user_defined_module
Attributes inherited from Composite
#children, #location, #name, #parent
Instance Method Summary collapse
-
#change_screen ⇒ Symbol?
Screen to change to.
- #change_to_previous_screen ⇒ Boolean
- #close_modal ⇒ Boolean
- #close_screen ⇒ Boolean
-
#empty? ⇒ Boolean
See if hook actions are empty.
-
#hook_order ⇒ Array<Symbol>
Get the order to run the hook in.
-
#length ⇒ Integer
Get length of hook actions.
-
#new_screen ⇒ Symbol?
New screen.
- #possible_screen_changes ⇒ Array
-
#reset_screen ⇒ Boolean
Reset the screen?.
- #show_modal ⇒ Symbol?
-
#sleep ⇒ Numeric
Amount of time to sleep.
-
#wait_for_elements ⇒ Array<HookElementRequirements>
Custom method for array of children instead of Hash.
Methods inherited from Composite
#create_composite, #get_child, #get_children, #get_page_object, #get_property, #initialize
Methods inherited from Composite
#add_has_many_relationships, #add_has_one_relationships, #get_child, #get_children, has_many, has_many_relationships, has_one, has_one_relationships, #initialize, #top
Methods included from Reflection
Methods included from CompositeHook
#after_create_run, #before_create_run, included
Constructor Details
This class inherits a constructor from AutomationObject::BluePrint::PageObjectAdapter::Composite
Instance Method Details
#change_screen ⇒ Symbol?
Returns screen to change to
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 29 def change_screen change_screen = hash[:change_screen] case change_screen when Symbol, String return change_screen.to_sym else return nil end end |
#change_to_previous_screen ⇒ Boolean
63 64 65 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 63 def change_to_previous_screen hash[:change_to_previous_screen] ||= false end |
#close_modal ⇒ Boolean
58 59 60 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 58 def close_modal hash[:close_modal] ||= false end |
#close_screen ⇒ Boolean
53 54 55 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 53 def close_screen hash[:close_screen] ||= false end |
#empty? ⇒ Boolean
See if hook actions are empty
24 25 26 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 24 def empty? hash.keys.empty? end |
#hook_order ⇒ Array<Symbol>
Get the order to run the hook in
12 13 14 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 12 def hook_order hash.keys end |
#length ⇒ Integer
Get length of hook actions
18 19 20 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 18 def length hash.keys.length end |
#new_screen ⇒ Symbol?
Returns new screen
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 41 def new_screen new_screen = hash[:new_screen] case new_screen when Symbol, String return new_screen.to_sym else return nil end end |
#possible_screen_changes ⇒ Array
80 81 82 83 84 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 80 def possible_screen_changes return hash[:possible_screen_changes].map(&:to_sym) if hash[:possible_screen_changes].is_a?(Array) [] end |
#reset_screen ⇒ Boolean
Returns reset the screen?
87 88 89 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 87 def reset_screen hash[:reset_screen] ||= false end |
#show_modal ⇒ Symbol?
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 68 def show_modal show_modal = hash[:show_modal] case show_modal when Symbol, String return show_modal.to_sym else return nil end end |
#sleep ⇒ Numeric
Returns amount of time to sleep
92 93 94 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 92 def sleep hash[:sleep] ||= 0 end |
#wait_for_elements ⇒ Array<HookElementRequirements>
Custom method for array of children instead of Hash
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/automation_object/blue_print/page_object_adapter/hook_action.rb', line 98 def wait_for_elements return @wait_for_elements if defined? @wait_for_elements wait_for_elements = hash[:wait_for_elements] children = wait_for_elements.is_a?(Array) ? wait_for_elements : [] @wait_for_elements = create_array_children(:wait_for_elements, children, interface: HookElementRequirements, location: location + '[wait_for_elements]') @wait_for_elements end |