Module: Extensible

Extended by:
ExtensionKernel
Defined in:
lib/extensible.rb,
lib/extensible/version.rb,
lib/extensible/constants.rb,
lib/extensible/extension_kernel.rb,
lib/extensible/extension_kernel_template.rb

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Modules: Error, ExtensionKernelTemplate

Constant Summary collapse

VERSION =

Current version of Extensible.

"0.0.2".freeze
ExtensionKernel =

A custom ExtensionKernelTemplate clone that is extended by Extensible to make it, well, extensible.

ExtensionKernelTemplate.clone.module_eval do
  private # rubocop:disable Style/EmptyLinesAroundAccessModifier

  def extended(submodule)
    super

    unless submodule.const_defined?(:ExtensionKernel, false)
      kernel = ExtensionKernelTemplate.clone
      submodule.const_set(:ExtensionKernel, kernel)
      submodule.extend kernel
    end

    self
  end

  self
end