Class: Restify::Registry
- Inherits:
-
Object
- Object
- Restify::Registry
- Extended by:
- Forwardable
- Defined in:
- lib/restify/registry.rb
Class Method Summary collapse
Instance Method Summary collapse
- #fetch(name) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #store(name, uri, **opts) ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
3 4 5 |
# File 'lib/restify/registry.rb', line 3 def initialize @registry = {} end |
Class Method Details
.instance ⇒ Object
18 19 20 |
# File 'lib/restify/registry.rb', line 18 def instance @instance ||= new end |
Instance Method Details
#fetch(name) ⇒ Object
11 12 13 |
# File 'lib/restify/registry.rb', line 11 def fetch(name) @registry.fetch name end |
#store(name, uri, **opts) ⇒ Object
7 8 9 |
# File 'lib/restify/registry.rb', line 7 def store(name, uri, **opts) @registry[name] = Context.new uri, **opts end |