Module: SwitchPoint::ClassMethods
- Included in:
- SwitchPoint
- Defined in:
- lib/switch_point.rb
Instance Method Summary collapse
- #config ⇒ Object
- #configure(&block) ⇒ Object
- #readonly!(name) ⇒ Object
- #readonly_all! ⇒ Object
- #writable!(name) ⇒ Object
- #writable_all! ⇒ Object
Instance Method Details
#config ⇒ Object
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.checkout(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.checkout(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 |