Sha256: f6e53a2a1a03a4c7154669eb682b491a76b615c5da631bae4e67a7c2cb92af12

Contents?: true

Size: 490 Bytes

Versions: 1

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

require_relative "resolve"

module FunRuby
  class Container
    # @private
    module Mixin
      # @private
      def self.build(aliases:)
        mixin = Module.new
        mixin.send(:define_method, :_resolve) { Resolve.build(aliases: aliases) }
        mixin.send(:include, self)
        mixin
      end

      private

      def _resolve
        @_resolve ||= Resolve.build
      end

      def f(key)
        _resolve.(key)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fun-ruby-0.0.1 lib/fun_ruby/container/mixin.rb