Module: AutomationObject::State::CommonElement
- Included in:
- Element, ElementArray, ElementHash
- Defined in:
- lib/automation_object/state/_common_element.rb
Overview
Helper module for Element composite classes
Instance Attribute Summary collapse
-
#active ⇒ Object
Whether or not modal is active.
-
#cache ⇒ Object
Returns the value of attribute cache.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Screen is active or not.
- #method_hook?(name) ⇒ Boolean
-
#method_hooks ⇒ Hash<Hook>
Array of Hook that are defined under the element.
- #method_to_container(name) ⇒ Object
- #reset ⇒ Object
Instance Attribute Details
#active ⇒ Object
Whether or not modal is active
12 13 14 |
# File 'lib/automation_object/state/_common_element.rb', line 12 def active @active end |
#cache ⇒ Object
Returns the value of attribute cache
9 10 11 |
# File 'lib/automation_object/state/_common_element.rb', line 9 def cache @cache end |
Instance Method Details
#active? ⇒ Boolean
Returns screen is active or not
15 16 17 |
# File 'lib/automation_object/state/_common_element.rb', line 15 def active? @active ||= false end |
#method_hook?(name) ⇒ Boolean
24 25 26 |
# File 'lib/automation_object/state/_common_element.rb', line 24 def method_hook?(name) blue_prints.method_hooks.key?(name) end |
#method_hooks ⇒ Hash<Hook>
Returns array of Hook that are defined under the element
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/automation_object/state/_common_element.rb', line 29 def method_hooks return @method_hooks if @method_hooks @method_hooks = {} blue_prints.method_hooks.each do |key, blue_prints| @method_hooks[key] = Hook.new(driver, blue_prints, key, self, location + "[#{key}]") end @method_hooks end |
#method_to_container(name) ⇒ Object
44 45 46 |
# File 'lib/automation_object/state/_common_element.rb', line 44 def method_to_container(name) blue_prints.method_to_container(name) end |
#reset ⇒ Object
19 20 21 22 |
# File 'lib/automation_object/state/_common_element.rb', line 19 def reset @active = false self.cache = nil end |