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

Instance Method Summary collapse

Instance Attribute Details

#activeObject

Whether or not modal is active



12
13
14
# File 'lib/automation_object/state/_common_element.rb', line 12

def active
  @active
end

#cacheObject

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

Returns:

  • (Boolean)

    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

Returns:

  • (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_hooksHash<Hook>

Returns array of Hook that are defined under the element

Returns:

  • (Hash<Hook>)

    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

#resetObject



19
20
21
22
# File 'lib/automation_object/state/_common_element.rb', line 19

def reset
  @active = false
  self.cache = nil
end