Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
end

class One < Obj
register :one
end

class Two < Obj
register :two
end

one = Obj[:one].new
two = Obj[:two].new
```