https://github.com/svenfuchs/registry
Ruby Class Registry
https://github.com/svenfuchs/registry
class registry ruby
Last synced: about 1 year ago
JSON representation
Ruby Class Registry
- Host: GitHub
- URL: https://github.com/svenfuchs/registry
- Owner: svenfuchs
- License: mit
- Created: 2019-04-22T15:23:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-14T13:41:31.000Z (over 6 years ago)
- Last Synced: 2024-04-24T09:17:48.004Z (about 2 years ago)
- Topics: class, registry, ruby
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Registry [](https://travis-ci.org/svenfuchs/registry)
Ruby class registry for registering, and looking up classes using a key, rather
than the class name. Decouples looking up classes from their name and namespace.
## Installation
```
gem install regstry
```
Note the missing `i` in the gem name. The name `registry` is taken by another gem.
## Usage
```ruby
require 'registry'
class Obj
include Registry
end
class One < Obj
register :one
end
class Two < Obj
register :two
end
one = Obj[:one].new
two = Obj[:two].new
```