Class: SmartCore::Container::DefinitionDSL::Commands::Definition::Namespace Private

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace_name, dependencies_definition) ⇒ 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)
  • dependencies_definition (Proc)

Since:

  • 0.7.0



19
20
21
22
23
24
# File 'lib/smart_core/container/definition_dsl/commands/definition/namespace.rb', line 19

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

Instance Attribute Details

#namespace_nameString (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)

Since:

  • 0.7.0



11
12
13
# File 'lib/smart_core/container/definition_dsl/commands/definition/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.7.0



31
32
33
# File 'lib/smart_core/container/definition_dsl/commands/definition/namespace.rb', line 31

def call(registry)
  registry.register_namespace(namespace_name, &dependencies_definition)
end

#dupSmartCore::Container::DefinitionDSL::Commands::Definition::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.



39
40
41
# File 'lib/smart_core/container/definition_dsl/commands/definition/namespace.rb', line 39

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