Module: SwitchPoint::ClassMethods

Included in:
SwitchPoint
Defined in:
lib/switch_point.rb

Instance Method Summary collapse

Instance Method Details

#configObject



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

def config
  @config ||= Config.new
end

#configure(&block) ⇒ Object



7
8
9
# File 'lib/switch_point.rb', line 7

def configure(&block)
  block.call(config)
end

#readonly!(name) ⇒ Object



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

def readonly!(name)
  ProxyRepository.find(name).readonly!
end

#readonly_all!Object



15
16
17
18
19
# File 'lib/switch_point.rb', line 15

def readonly_all!
  config.keys.each do |name|
    readonly!(name)
  end
end

#writable!(name) ⇒ Object



31
32
33
# File 'lib/switch_point.rb', line 31

def writable!(name)
  ProxyRepository.find(name).writable!
end

#writable_all!Object



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

def writable_all!
  config.keys.each do |name|
    writable!(name)
  end
end