Class: SwitchPoint::ProxyRepository

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/switch_point/proxy_repository.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.checkout(name) ⇒ Object



10
11
12
# File 'lib/switch_point/proxy_repository.rb', line 10

def self.checkout(name)
  instance.checkout(name)
end

.find(name) ⇒ Object



14
15
16
# File 'lib/switch_point/proxy_repository.rb', line 14

def self.find(name)
  instance.find(name)
end

Instance Method Details

#checkout(name) ⇒ Object



18
19
20
# File 'lib/switch_point/proxy_repository.rb', line 18

def checkout(name)
  proxies[name] ||= Proxy.new(name)
end

#find(name) ⇒ Object



22
23
24
# File 'lib/switch_point/proxy_repository.rb', line 22

def find(name)
  proxies.fetch(name)
end

#proxiesObject



26
27
28
# File 'lib/switch_point/proxy_repository.rb', line 26

def proxies
  @proxies ||= {}
end