Module: SmartCore::Container::Mixin::ClassMethods Private

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

Version:

  • 0.11.0

Instance Method Summary collapse

Instance Method Details

#containerSmartCore::Container

Returns:

Since:

  • 0.1.0

Version:

  • 0.11.0



72
73
74
75
76
# File 'lib/smart_core/container/mixin.rb', line 72

def container
  @__smart_core_container_access_lock__.read_sync do
    @__smart_core_container__ ||= @__smart_core_container_klass__.new
  end
end

#dependencies(freeze_state: false, &block) ⇒ void

This method returns an undefined value.

Parameters:

  • freeze_state (Boolean) (defaults to: false)
  • block (Proc)

Since:

  • 0.1.0

Version:

  • 0.11.0



60
61
62
63
64
65
# File 'lib/smart_core/container/mixin.rb', line 60

def dependencies(freeze_state: false, &block)
  @__smart_core_container_access_lock__.write_sync do
    @__smart_core_container_klass__.instance_eval(&block) if block_given?
    @__smart_core_container_klass__.instance_eval { freeze_state! } if freeze_state
  end
end