Class: Mooncell::Protocol::Registry Private
- Inherits:
-
Object
- Object
- Mooncell::Protocol::Registry
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/mooncell/protocol/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
-
#initialize ⇒ Registry
constructor
private
A new instance of Registry.
- #lookup(name) ⇒ Object private
- #register(klass) ⇒ Object private
Constructor Details
#initialize ⇒ Registry
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 a new instance of Registry.
19 20 21 |
# File 'lib/mooncell/protocol/registry.rb', line 19 def initialize @protocols = Concurrent::Map.new end |
Instance Method Details
#lookup(name) ⇒ Object
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.
28 29 30 |
# File 'lib/mooncell/protocol/registry.rb', line 28 def lookup(name) @protocols[name] end |
#register(klass) ⇒ Object
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.
23 24 25 26 |
# File 'lib/mooncell/protocol/registry.rb', line 23 def register(klass) name = klass.name.split('::').last.downcase @protocols[name] = klass end |