Module: LibraryTree::Watcher::ClassMethods

Defined in:
lib/library_tree/watcher.rb

Instance Method Summary collapse

Instance Method Details

#included(base) ⇒ void

This method returns an undefined value.

Called whenever the watched module (‘self`) is included into another module (`base`).

Parameters:

  • base (Module)

    the including module



13
14
15
16
17
18
19
# File 'lib/library_tree/watcher.rb', line 13

def included(base)
  super
  # Link whenever the included module (self) is tracked, regardless of whether the includer (base) is tracked.
  if LibraryTree::Registry.tracked?(self)
    LibraryTree::Registry.link(base, self)
  end
end