Module: AePageObjects::DependenciesHook

Defined in:
lib/ae_page_objects/core/dependencies_hook.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.containing_page_object_universe(from_mod) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ae_page_objects/core/dependencies_hook.rb', line 4

def self.containing_page_object_universe(from_mod)
  until from_mod == Object
    if from_mod < AePageObjects::ConstantResolver
      return from_mod
    end
    
    from_mod = from_mod.parent
  end
  
  nil
end

Instance Method Details

#load_missing_constant(from_mod, const_name) ⇒ Object



16
17
18
19
# File 'lib/ae_page_objects/core/dependencies_hook.rb', line 16

def load_missing_constant(from_mod, const_name)
  page_objects = DependenciesHook.containing_page_object_universe(from_mod)
  page_objects && page_objects.load_missing_constant(from_mod, const_name) || super
end