Class: FeatureFlagger::Control
- Inherits:
-
Object
- Object
- FeatureFlagger::Control
- Defined in:
- lib/feature_flagger/control.rb
Instance Attribute Summary collapse
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
-
#initialize(storage) ⇒ Control
constructor
A new instance of Control.
- #release!(feature_key, resource_id) ⇒ Object
- #resource_ids(feature_key) ⇒ Object
- #rollout?(feature_key, resource_id) ⇒ Boolean
- #unrelease!(feature_key, resource_id) ⇒ Object
Constructor Details
#initialize(storage) ⇒ Control
Returns a new instance of Control.
5 6 7 |
# File 'lib/feature_flagger/control.rb', line 5 def initialize(storage) @storage = storage end |
Instance Attribute Details
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
3 4 5 |
# File 'lib/feature_flagger/control.rb', line 3 def storage @storage end |
Instance Method Details
#release!(feature_key, resource_id) ⇒ Object
13 14 15 |
# File 'lib/feature_flagger/control.rb', line 13 def release!(feature_key, resource_id) @storage.add(feature_key, resource_id) end |
#resource_ids(feature_key) ⇒ Object
21 22 23 |
# File 'lib/feature_flagger/control.rb', line 21 def resource_ids(feature_key) @storage.all_values(feature_key) end |
#rollout?(feature_key, resource_id) ⇒ Boolean
9 10 11 |
# File 'lib/feature_flagger/control.rb', line 9 def rollout?(feature_key, resource_id) @storage.has_value?(feature_key, resource_id) end |
#unrelease!(feature_key, resource_id) ⇒ Object
17 18 19 |
# File 'lib/feature_flagger/control.rb', line 17 def unrelease!(feature_key, resource_id) @storage.remove(feature_key, resource_id) end |