Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svenfuchs/registry
Ruby Class Registry
https://github.com/svenfuchs/registry
class registry ruby
Last synced: 12 days 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-14T13:41:31.000Z (almost 5 years ago)
- Last Synced: 2024-04-24T09:17:48.004Z (8 months 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 [![Build Status](https://travis-ci.org/svenfuchs/registry.svg?branch=master)](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
endclass One < Obj
register :one
endclass Two < Obj
register :two
endone = Obj[:one].new
two = Obj[:two].new
```