Class: SmartCore::Container::MemoizedDependency Private

Inherits:
Dependency show all
Defined in:
lib/smart_core/container/memoized_dependency.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

Attributes inherited from Entity

#external_name

Instance Method Summary collapse

Constructor Details

#initialize(external_name, dependency_definition, **options) ⇒ 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.

TODO:

option list

Parameters:

  • external_name (String)
  • dependency_definition (Proc)
  • options (Hash<Symbol,Any>)

See Also:

  • SmartCore::Container::MemoizedDependency.[SmartCore[SmartCore::Container[SmartCore::Container::Dependency]

Since:

  • 0.5.0



16
17
18
19
# File 'lib/smart_core/container/memoized_dependency.rb', line 16

def initialize(external_name, dependency_definition, **options)
  @memoized_call = nil
  super
end

Instance Method Details

#callAny

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:

  • (Any)

Since:

  • 0.5.0



25
26
27
# File 'lib/smart_core/container/memoized_dependency.rb', line 25

def call
  thread_safe { @memoized_call ||= dependency_definition.call }
end