Class: SmartCore::Container::Dependency Private

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

Direct Known Subclasses

MemoizedDependency

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:

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

Since:

  • 0.5.0



14
15
16
17
18
# File 'lib/smart_core/container/dependency.rb', line 14

def initialize(external_name, dependency_definition, **options)
  @dependency_definition = dependency_definition
  @access_lock = Mutex.new
  super(external_name)
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



24
25
26
# File 'lib/smart_core/container/dependency.rb', line 24

def call
  thread_safe { dependency_definition.call }
end