Class: Restify::Registry

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/restify/registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



5
6
7
# File 'lib/restify/registry.rb', line 5

def initialize
  @registry = {}
end

Class Method Details

.instanceObject



20
21
22
# File 'lib/restify/registry.rb', line 20

def instance
  @instance ||= new
end

Instance Method Details

#fetch(name) ⇒ Object



13
14
15
# File 'lib/restify/registry.rb', line 13

def fetch(name)
  @registry.fetch name
end

#store(name, uri, **opts) ⇒ Object



9
10
11
# File 'lib/restify/registry.rb', line 9

def store(name, uri, **opts)
  @registry[name] = Context.new uri, **opts
end