Class: FeatureFlagger::Configuration
- Inherits:
-
Object
- Object
- FeatureFlagger::Configuration
- Defined in:
- lib/feature_flagger/configuration.rb
Instance Attribute Summary collapse
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#yaml_filepath ⇒ Object
Returns the value of attribute yaml_filepath.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #mapped_feature_keys(resource_name = nil) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 |
# File 'lib/feature_flagger/configuration.rb', line 5 def initialize @storage ||= Storage::Redis.default_client @yaml_filepath ||= default_yaml_filepath end |
Instance Attribute Details
#storage ⇒ Object
Returns the value of attribute storage.
3 4 5 |
# File 'lib/feature_flagger/configuration.rb', line 3 def storage @storage end |
#yaml_filepath ⇒ Object
Returns the value of attribute yaml_filepath.
3 4 5 |
# File 'lib/feature_flagger/configuration.rb', line 3 def yaml_filepath @yaml_filepath end |
Instance Method Details
#info ⇒ Object
10 11 12 |
# File 'lib/feature_flagger/configuration.rb', line 10 def info @info ||= YAML.load_file(yaml_filepath) if yaml_filepath end |
#mapped_feature_keys(resource_name = nil) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/feature_flagger/configuration.rb', line 14 def mapped_feature_keys(resource_name = nil) info_filtered = resource_name ? info[resource_name] : info [].tap do |keys| make_keys_recursively(info_filtered).each { |key| keys.push(join_key(resource_name, key)) } end end |