module Algebrick::Reclude

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

noinspection RubySuperCallWithoutSuperclassInspection

Public Instance Methods

include(*modules) click to toggle source
Calls superclass method
# File lib/algebrick/reclude.rb, line 24
def include(*modules)
  super(*modules)
  modules.reverse.each do |module_being_included|
    included_into.each do |mod|
      mod.send :include, module_being_included
    end
  end
end
included(base) click to toggle source
Calls superclass method
# File lib/algebrick/reclude.rb, line 19
def included(base)
  included_into << base
  super(base)
end

Private Instance Methods

included_into() click to toggle source
# File lib/algebrick/reclude.rb, line 35
def included_into
  @included_into ||= []
end