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
14 15 16 |
# File 'lib/feature/repository/simple_repository.rb', line 14 def initialize @active_features = [] end |
Instance Method Details
#active_features ⇒ Array<Symbol>
Returns list of active features
22 23 24 |
# File 'lib/feature/repository/simple_repository.rb', line 22 def active_features @active_features.dup end |
#add_active_feature(feature) ⇒ Object
Add an active feature to repository
30 31 32 33 34 |
# File 'lib/feature/repository/simple_repository.rb', line 30 def add_active_feature(feature) check_feature_is_not_symbol(feature) check_feature_already_in_list(feature) @active_features << feature end |