Class: SmartCore::Container::Commands::Namespace Private

Inherits:
Base
  • Object
show all
Defined in:
lib/smart_core/container/commands/namespace.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:

  • 0.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace_name, dependency_definitions) ⇒ void

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.

Parameters:

  • namespace_name (String, Symbol)
  • dependency_definitions (Proc)

See Also:

  • SmartCore::Container::Commands::Namespace.[SmartCore[SmartCore::Container[SmartCore::Container::KeyGuard]

Since:

  • 0.5.0



21
22
23
24
25
26
# File 'lib/smart_core/container/commands/namespace.rb', line 21

def initialize(namespace_name, dependency_definitions)
  SmartCore::Container::KeyGuard.indifferently_accessable_key(namespace_name).tap do |name|
    @namespace_name = name
    @dependency_definitions = dependency_definitions
  end
end

Instance Attribute Details

#namespace_nameString, Symbol (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.

Returns:

  • (String, Symbol)

Since:

  • 0.5.0



11
12
13
# File 'lib/smart_core/container/commands/namespace.rb', line 11

def namespace_name
  @namespace_name
end

Instance Method Details

#call(registry) ⇒ void

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.

This method returns an undefined value.

Parameters:

Since:

  • 0.5.0



33
34
35
# File 'lib/smart_core/container/commands/namespace.rb', line 33

def call(registry)
  registry.namespace(namespace_name, &dependency_definitions)
end

#dupSmartCore::Container::Commands::Namespace

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.



41
42
43
# File 'lib/smart_core/container/commands/namespace.rb', line 41

def dup
  self.class.new(namespace_name, dependency_definitions)
end