Module: Algebrick::Reclude

Included in:
Type
Defined in:
lib/algebrick/reclude.rb

Overview

fix module to re-include itself to where it was already included when a module is included into it noinspection RubySuperCallWithoutSuperclassInspection

Instance Method Summary collapse

Instance Method Details

#extended(base) ⇒ Object



24
25
26
27
# File 'lib/algebrick/reclude.rb', line 24

def extended(base)
  used_by << base
  super(base)
end

#include(*modules) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/algebrick/reclude.rb', line 29

def include(*modules)
  super(*modules)
  modules.reverse.each do |module_being_included|
    used_by.each do |mod|
      mod.send :include, module_being_included
    end
  end
end

#included(base) ⇒ Object



19
20
21
22
# File 'lib/algebrick/reclude.rb', line 19

def included(base)
  used_by << base
  super(base)
end