Class: Togls::FeatureRegistry
- Inherits:
-
Object
- Object
- Togls::FeatureRegistry
- Defined in:
- lib/togls/feature_registry.rb
Class Method Summary collapse
Instance Method Summary collapse
- #feature(tag) ⇒ Object
- #get(key) ⇒ Object
-
#initialize ⇒ FeatureRegistry
constructor
A new instance of FeatureRegistry.
Constructor Details
#initialize ⇒ FeatureRegistry
Returns a new instance of FeatureRegistry.
3 4 5 6 |
# File 'lib/togls/feature_registry.rb', line 3 def initialize @registry = {} @default_feature = Feature.new(:default).tap {|f| f.on(Rule.new { false }) } end |
Class Method Details
.create(&features) ⇒ Object
8 9 10 11 12 |
# File 'lib/togls/feature_registry.rb', line 8 def self.create(&features) registry = self.new registry.instance_eval(&features) registry end |