Class: Enabler::Config
- Inherits:
-
Object
- Object
- Enabler::Config
- Includes:
- Singleton
- Defined in:
- lib/enabler/config.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
- #after_disabling(feature, &block) ⇒ Object
- #after_disablings ⇒ Object
- #after_enabling(feature, &block) ⇒ Object
- #after_enablings ⇒ Object
- #persistence(val) ⇒ Object
- #rule(feature, &block) ⇒ Object
- #rules ⇒ Object
Instance Attribute Details
#store ⇒ Object
Returns the value of attribute store.
5 6 7 |
# File 'lib/enabler/config.rb', line 5 def store @store end |
Instance Method Details
#after_disabling(feature, &block) ⇒ Object
19 20 21 |
# File 'lib/enabler/config.rb', line 19 def after_disabling(feature, &block) after_disablings[feature.to_sym] = block end |
#after_disablings ⇒ Object
31 32 33 |
# File 'lib/enabler/config.rb', line 31 def after_disablings @after_disablings ||= {} end |
#after_enabling(feature, &block) ⇒ Object
15 16 17 |
# File 'lib/enabler/config.rb', line 15 def after_enabling(feature, &block) after_enablings[feature.to_sym] = block end |
#after_enablings ⇒ Object
27 28 29 |
# File 'lib/enabler/config.rb', line 27 def after_enablings @after_enablings ||= {} end |
#persistence(val) ⇒ Object
11 12 13 |
# File 'lib/enabler/config.rb', line 11 def persistence(val) self.store = val end |
#rule(feature, &block) ⇒ Object
7 8 9 |
# File 'lib/enabler/config.rb', line 7 def rule(feature, &block) rules << Rule.new(feature.to_sym, block) end |
#rules ⇒ Object
23 24 25 |
# File 'lib/enabler/config.rb', line 23 def rules @rules ||= [] end |