Class: Hanami::ProviderRegistrar Private

Inherits:
Dry::System::ProviderRegistrar
  • Object
show all
Defined in:
lib/hanami/provider_registrar.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container, slice) ⇒ ProviderRegistrar

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ProviderRegistrar.

Since:

  • 2.2.0



17
18
19
20
# File 'lib/hanami/provider_registrar.rb', line 17

def initialize(container, slice)
  super(container)
  @slice = slice
end

Instance Attribute Details

#sliceObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



15
16
17
# File 'lib/hanami/provider_registrar.rb', line 15

def slice
  @slice
end

Class Method Details

.for_slice(slice) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



7
8
9
10
11
12
13
# File 'lib/hanami/provider_registrar.rb', line 7

def self.for_slice(slice)
  Class.new(self) do
    define_singleton_method(:new) do |container|
      super(container, slice)
    end
  end
end

Instance Method Details

#provider_source_classObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



22
# File 'lib/hanami/provider_registrar.rb', line 22

def provider_source_class = Hanami::Provider::Source

#provider_source_optionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



24
25
26
# File 'lib/hanami/provider_registrar.rb', line 24

def provider_source_options
  {slice: slice}
end