Module: BeforeHooks

Defined in:
lib/before_hooks.rb,
lib/before_hooks/version.rb

Constant Summary collapse

VERSION =
'0.1.4'

Instance Method Summary collapse

Instance Method Details

#extend(*modules) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/before_hooks.rb', line 4

def extend(*modules)
  modules.each do |_module|
    if _module.respond_to? :before_extended
      _module.before_extended(self)
    end
  end

  super
end

#include(*modules) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/before_hooks.rb', line 14

def include(*modules)
  modules.each do |_module|
    if _module.respond_to? :before_included
      _module.before_included(self)
    end
  end

  super
end

#prepend(*modules) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/before_hooks.rb', line 24

def prepend(*modules)
  modules.each do |_module|
    if _module.respond_to? :before_prepended
      _module.before_prepended(self)
    end
  end

  super
end