Module: SmartCore::Container::DependencyBuilder Private

Defined in:
lib/smart_core/container/dependency_builder.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.5.0

Class Method Summary collapse

Class Method Details

.build(external_name, dependency_definition, memoize: false, **options) ⇒ SmartCore::Container::Dependency, SmartCore::Container::MemoizedDependency

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:

  • external_name (String)
  • dependency_definition (Proc)
  • memoize (Hash) (defaults to: false)

    a customizable set of options

Options Hash (memoize:):

  • (Boolean)

Returns:

Since:

  • 0.5.0



14
15
16
17
18
19
20
21
22
# File 'lib/smart_core/container/dependency_builder.rb', line 14

def build(external_name, dependency_definition, memoize: false, **options)
  # @todo: raise an error if memoize is not a boolean

  if memoize
    build_memoized_dependency(external_name, dependency_definition, **options)
  else
    build_dependency(external_name, dependency_definition, **options)
  end
end