module Extensible::ExtensionKernelTemplate

ExtensionKernelTemplate serves as the initial template for all extension kernels that are used internally by Extensible. Each extensible module will extend a clone of ExtensionKernelTemplate that will allow it to execute its own initialization code.

Private Class Methods

initialize_copy(_source) → extension_kernel_template click to toggle source

Passes _source to super and overrides the Module#included method in order to extend self on including modules.

Returns self object.

Calls superclass method
# File lib/extensible/extension_kernel_template.rb, line 18
def initialize_copy(_source)
  super

  this_kernel = self

  define_method :included do |submodule|
    super submodule
    submodule.extend this_kernel
    self
  end

  private :included

  self
end