Sha256: 9b9c62de34a1fb685e1e26e044f00f5457f038093ce045f4f00a4bcac7442ee7
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
# frozen_string_literal: true # @api private # @since 0.1.0 class SmartCore::Container::Entities::Namespace < SmartCore::Container::Entities::Base # @return [String] # # @api private # @since 0.1.0 alias_method :namespace_name, :external_name # @param namespace_name [String] # @return [void] # # @api private # @since 0.1.0 def initialize(namespace_name) super(namespace_name) @container_klass = Class.new(SmartCore::Container) @container_instance = nil @lock = SmartCore::Container::ArbitraryLock.new end # @return [SmartCore::Container] # # @api private # @since 0.1.0 def reveal thread_safe { container_instance } end # @param dependencies_definition [Proc] # @return [void] # # @api private # @since 0.1.0 def append_definitions(dependencies_definition) thread_safe { container_klass.instance_eval(&dependencies_definition) } end # @return [void] # # @api private # @since 0.1.0 def freeze! thread_safe { container_instance.freeze! } end private # @return [Class<SmartCore::Container>] # # @api private # @since 0.1.0 attr_reader :container_klass # @return [SmartCore::Container] # # @api private # @since 0.1.0 def container_instance @container_instance ||= container_klass.new end # @param block [Block] # @return [Any] # # @api private # @since 0.1.0 def thread_safe(&block) @lock.thread_safe(&block) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
smart_container-0.8.0 | lib/smart_core/container/entities/namespace.rb |