Sha256: 95e29ea01874030f7e70c18fd3e5955856be6ea139b72d7f6d564042f68a0e1b

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require "zeitwerk"

require "dry/core/constants"
require "dry/core/errors"
require "dry/core/version"

# :nodoc:
module Dry
  # :nodoc:
  module Core
    include Constants

    def self.loader
      @loader ||= Zeitwerk::Loader.new.tap do |loader|
        root = File.expand_path("..", __dir__)
        loader.tag = "dry-core"
        loader.inflector = Zeitwerk::GemInflector.new("#{root}/dry-core.rb")
        loader.push_dir(root)
        loader.ignore(
          "#{root}/dry-core.rb",
          "#{root}/dry/core/{constants,errors,version}.rb"
        )
      end
    end

    loader.setup
  end

  # See dry/core/equalizer.rb
  unless singleton_class.method_defined?(:Equalizer)
    # Build an equalizer module for the inclusion in other class
    #
    # ## Credits
    #
    # Equalizer has been originally imported from the equalizer gem created by Dan Kubb
    #
    # @api public
    def self.Equalizer(*keys, **options)
      Dry::Core::Equalizer.new(*keys, **options)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-core-0.9.1 lib/dry/core.rb
dry-core-0.9.0 lib/dry/core.rb