Sha256: 9961ae621a1c08c74af33d0eaf60a5fb0651a9e0bc6b6b1632d46bf3e46c9913

Contents?: true

Size: 385 Bytes

Versions: 1

Compression:

Stored size: 385 Bytes

Contents

# frozen_string_literal: true

module SimpleInjector
  # Module to handle instance registrations
  class Contract
    class << self
      def register(name, callback)
        class_name = to_s

        Inject.register(class_name, name, callback)
      end

      def find(name)
        class_name = to_s

        Inject.find(class_name, name).callback.call
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_injector-0.0.2 lib/simple_injector/contract.rb