Class: Flipper::Adapters::Strict
- Defined in:
- lib/flipper/adapters/strict.rb
Overview
An adapter that ensures a feature exists before checking it.
Defined Under Namespace
Classes: NotFound
Constant Summary
Constants inherited from Wrapper
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
Attributes inherited from Wrapper
Instance Method Summary collapse
- #get(feature) ⇒ Object
- #get_multi(features) ⇒ Object
-
#initialize(adapter, handler = nil, &block) ⇒ Strict
constructor
A new instance of Strict.
Methods inherited from Wrapper
Methods included from Flipper::Adapter
#default_config, #export, #get_all, #import, included, #name, #read_only?
Constructor Details
#initialize(adapter, handler = nil, &block) ⇒ Strict
Returns a new instance of Strict.
13 14 15 16 |
# File 'lib/flipper/adapters/strict.rb', line 13 def initialize(adapter, handler = nil, &block) super(adapter) @handler = block || handler end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
5 6 7 |
# File 'lib/flipper/adapters/strict.rb', line 5 def handler @handler end |
Instance Method Details
#get(feature) ⇒ Object
18 19 20 21 |
# File 'lib/flipper/adapters/strict.rb', line 18 def get(feature) assert_feature_exists(feature) super end |
#get_multi(features) ⇒ Object
23 24 25 26 |
# File 'lib/flipper/adapters/strict.rb', line 23 def get_multi(features) features.each { |feature| assert_feature_exists(feature) } super end |