Class: Feature::Repository::SimpleRepository
- Inherits:
-
Object
- Object
- Feature::Repository::SimpleRepository
- Defined in:
- lib/feature/repository/simple_repository.rb
Overview
SimpleRepository for active feature list Simply add features to that should be active, no config or data sources required.
Example usage:
repository = SimpleRepository.new
repository.add_active_feature(:feature_name)
# use repository with Feature
Instance Method Summary collapse
-
#active_features ⇒ Array<Symbol>
Returns list of active features.
-
#add_active_feature(feature) ⇒ Object
Add an active feature to repository.
-
#initialize ⇒ SimpleRepository
constructor
Constructor.
Constructor Details
#initialize ⇒ SimpleRepository
Constructor
15 16 17 |
# File 'lib/feature/repository/simple_repository.rb', line 15 def initialize @active_features = [] end |
Instance Method Details
#active_features ⇒ Array<Symbol>
Returns list of active features
23 24 25 |
# File 'lib/feature/repository/simple_repository.rb', line 23 def active_features @active_features.dup end |
#add_active_feature(feature) ⇒ Object
Add an active feature to repository
31 32 33 34 35 |
# File 'lib/feature/repository/simple_repository.rb', line 31 def add_active_feature(feature) check_feature_is_not_symbol(feature) check_feature_already_in_list(feature) @active_features << feature end |