Class: GenServer::Registry
- Inherits:
-
Object
- Object
- GenServer::Registry
- Includes:
- Singleton
- Defined in:
- lib/gen_server/registry.rb,
lib/gen_server/registry/info.rb
Defined Under Namespace
Classes: Info
Instance Attribute Summary collapse
-
#pids ⇒ Object
readonly
Returns the value of attribute pids.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
Constructor Details
#initialize ⇒ Registry
11 12 13 |
# File 'lib/gen_server/registry.rb', line 11 def initialize @pids = {} end |
Instance Attribute Details
#pids ⇒ Object (readonly)
Returns the value of attribute pids.
9 10 11 |
# File 'lib/gen_server/registry.rb', line 9 def pids @pids end |
Class Method Details
.[]=(pid, info) ⇒ Object
16 17 18 |
# File 'lib/gen_server/registry.rb', line 16 def []=(pid, info) instance.pids[pid] = info end |
.actor(pid) ⇒ Object
20 21 22 |
# File 'lib/gen_server/registry.rb', line 20 def actor(pid) instance.pids.fetch(pid).actor end |
.klass(pid) ⇒ Object
24 25 26 |
# File 'lib/gen_server/registry.rb', line 24 def klass(pid) instance.pids.fetch(pid).klass end |