Module: SmartCore::Container::DefinitionDSL::ClassMethods Private

Defined in:
lib/smart_core/container/definition_dsl.rb

Overview

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

Since:

  • 0.7.0

Instance Method Summary collapse

Instance Method Details

#compose(container_klass) ⇒ void

This method returns an undefined value.

Parameters:

Since:

  • 0.7.0



93
94
95
96
97
98
99
100
101
102
103
# File 'lib/smart_core/container/definition_dsl.rb', line 93

def compose(container_klass)
  @__container_definition_lock__.thread_safe do
    __container_definition_commands__ << Commands::Definition::Compose.new(
      container_klass
    )

    __container_instantiation_commands__ << Commands::Instantiation::Compose.new(
      container_klass
    )
  end
end

#freeze_state!void

This method returns an undefined value.

Since:

  • 0.7.0



109
110
111
112
113
# File 'lib/smart_core/container/definition_dsl.rb', line 109

def freeze_state!
  @__container_definition_lock__.thread_safe do
    __container_instantiation_commands__ << Commands::Instantiation::FreezeState.new
  end
end

#namespace(namespace_name, &dependencies_definition) ⇒ void

This method returns an undefined value.

Parameters:

  • namespace_name (String, Symbol)
  • dependencies_definition (Block)

Since:

  • 0.7.0



62
63
64
65
66
67
68
69
70
# File 'lib/smart_core/container/definition_dsl.rb', line 62

def namespace(namespace_name, &dependencies_definition)
  @__container_definition_lock__.thread_safe do
    DependencyCompatability::Definition.prevent_dependency_overlap!(self, namespace_name)

    __container_definition_commands__ << Commands::Definition::Namespace.new(
      namespace_name, dependencies_definition
    )
  end
end

#register(dependency_name, &dependency_definition) ⇒ void

This method returns an undefined value.

Parameters:

  • dependency_name (String, Symbol)
  • dependency_definition (Block)

Since:

  • 0.7.0



78
79
80
81
82
83
84
85
86
# File 'lib/smart_core/container/definition_dsl.rb', line 78

def register(dependency_name, &dependency_definition)
  @__container_definition_lock__.thread_safe do
    DependencyCompatability::Definition.prevent_namespace_overlap!(self, dependency_name)

    __container_definition_commands__ << Commands::Definition::Register.new(
      dependency_name, dependency_definition
    )
  end
end