Class: Philiprehberger::FeatureFlag::Configuration
- Inherits:
-
Object
- Object
- Philiprehberger::FeatureFlag::Configuration
- Defined in:
- lib/philiprehberger/feature_flag/configuration.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
Returns the value of attribute backend.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #use(type, **options) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 |
# File 'lib/philiprehberger/feature_flag/configuration.rb', line 8 def initialize @backend = Backends::MemoryBackend.new end |
Instance Attribute Details
#backend ⇒ Object
Returns the value of attribute backend.
6 7 8 |
# File 'lib/philiprehberger/feature_flag/configuration.rb', line 6 def backend @backend end |
Instance Method Details
#use(type, **options) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/philiprehberger/feature_flag/configuration.rb', line 12 def use(type, **) @backend = case type when :memory then Backends::MemoryBackend.new when :env then Backends::EnvBackend.new when :yaml then Backends::YamlBackend.new([:path]) else raise ArgumentError, "unknown backend: #{type}" end end |