Class: SmartCore::Initializer::TypeSystem::Registry Private
- Inherits:
-
Object
- Object
- SmartCore::Initializer::TypeSystem::Registry
- Includes:
- Enumerable
- Defined in:
- lib/smart_core/initializer/type_system/registry.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.
Instance Method Summary collapse
- #each(&block) {|system_name, system_interop| ... } ⇒ Enumerable private
- #initialize ⇒ void constructor private
- #interops ⇒ Array<Class<SmartCore::Initializer::TypeSystem::Interop>> private
- #names ⇒ Array<String> private
- #register(system_identifier, interop_klass) ⇒ void private
- #resolve(system_identifier) ⇒ Class<SmartCore::Initializer::TypeSystem::Interop> private
-
#to_h ⇒ Hash<String,Class<SmartCore::Initializer::TypeSystem::Interop>]
(also: #to_hash)
private
Hash<String,Class<SmartCore::Initializer::TypeSystem::Interop>].
Constructor Details
#initialize ⇒ 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.
15 16 17 18 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 15 def initialize @systems = {} @lock = SmartCore::Engine::ReadWriteLock.new end |
Instance Method Details
#each(&block) {|system_name, system_interop| ... } ⇒ Enumerable
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.
68 69 70 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 68 def each(&block) @lock.read_sync { iterate(&block) } end |
#interops ⇒ Array<Class<SmartCore::Initializer::TypeSystem::Interop>>
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.
55 56 57 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 55 def interops @lock.read_sync { system_interops } end |
#names ⇒ Array<String>
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.
46 47 48 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 46 def names @lock.read_sync { system_names } end |
#register(system_identifier, interop_klass) ⇒ 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.
This method returns an undefined value.
27 28 29 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 27 def register(system_identifier, interop_klass) @lock.write_sync { apply(system_identifier, interop_klass) } end |
#resolve(system_identifier) ⇒ Class<SmartCore::Initializer::TypeSystem::Interop>
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.
37 38 39 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 37 def resolve(system_identifier) @lock.read_sync { fetch(system_identifier) } end |
#to_h ⇒ Hash<String,Class<SmartCore::Initializer::TypeSystem::Interop>] Also known as: to_hash
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 Hash<String,Class<SmartCore::Initializer::TypeSystem::Interop>].
77 78 79 |
# File 'lib/smart_core/initializer/type_system/registry.rb', line 77 def to_h @lock.write_sync { systems.dup } end |