Method: AutomationObject::BluePrint::HashAdapter::ElementHelper#method_hooks

Defined in:
lib/automation_object/blue_print/hash_adapter/helpers/element_helper.rb

#method_hooksHash<Hook>

Returns hash of Hook that are defined under the element.

Returns:

  • (Hash<Hook>)

    hash of Hook that are defined under the element



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/automation_object/blue_print/hash_adapter/helpers/element_helper.rb', line 40

def method_hooks
  return @method_hooks if defined? @method_hooks

  children = {}
  hash.each do |key, value|
    # Skip possible keys that elements can have
    # Otherwise should be a method hook
    next if i[load custom_methods in_iframe css xpath define_elements_by custom_range].include?(key)
    children[key] = value
  end

  @method_hooks = create_hash_children(children,
                                       interface: Hook,
                                       location: location + '[hook]')

  @method_hooks
end