Class: Flipper::FeatureCheckContext
- Inherits:
-
Object
- Object
- Flipper::FeatureCheckContext
- Defined in:
- lib/flipper/feature_check_context.rb
Instance Attribute Summary collapse
-
#feature_name ⇒ Object
readonly
Public: The name of the feature.
-
#thing ⇒ Object
readonly
Public: The thing we want to know if a feature is enabled for.
-
#values ⇒ Object
readonly
Public: The GateValues instance that keeps track of the values for the gates for the feature.
Instance Method Summary collapse
-
#actors_value ⇒ Object
Public: Convenience method for actors value value like Feature has.
-
#boolean_value ⇒ Object
Public: Convenience method for boolean value value like Feature has.
-
#groups_value ⇒ Object
Public: Convenience method for groups value like Feature has.
-
#initialize(options = {}) ⇒ FeatureCheckContext
constructor
A new instance of FeatureCheckContext.
-
#percentage_of_actors_value ⇒ Object
Public: Convenience method for percentage of actors value like Feature has.
-
#percentage_of_time_value ⇒ Object
Public: Convenience method for percentage of time value like Feature has.
Constructor Details
#initialize(options = {}) ⇒ FeatureCheckContext
Returns a new instance of FeatureCheckContext.
13 14 15 16 17 |
# File 'lib/flipper/feature_check_context.rb', line 13 def initialize( = {}) @feature_name = .fetch(:feature_name) @values = .fetch(:values) @thing = .fetch(:thing) end |
Instance Attribute Details
#feature_name ⇒ Object (readonly)
Public: The name of the feature.
4 5 6 |
# File 'lib/flipper/feature_check_context.rb', line 4 def feature_name @feature_name end |
#thing ⇒ Object (readonly)
Public: The thing we want to know if a feature is enabled for.
11 12 13 |
# File 'lib/flipper/feature_check_context.rb', line 11 def thing @thing end |
#values ⇒ Object (readonly)
Public: The GateValues instance that keeps track of the values for the gates for the feature.
8 9 10 |
# File 'lib/flipper/feature_check_context.rb', line 8 def values @values end |
Instance Method Details
#actors_value ⇒ Object
Public: Convenience method for actors value value like Feature has.
25 26 27 |
# File 'lib/flipper/feature_check_context.rb', line 25 def actors_value values.actors end |
#boolean_value ⇒ Object
Public: Convenience method for boolean value value like Feature has.
30 31 32 |
# File 'lib/flipper/feature_check_context.rb', line 30 def boolean_value values.boolean end |
#groups_value ⇒ Object
Public: Convenience method for groups value like Feature has.
20 21 22 |
# File 'lib/flipper/feature_check_context.rb', line 20 def groups_value values.groups end |
#percentage_of_actors_value ⇒ Object
Public: Convenience method for percentage of actors value like Feature has.
35 36 37 |
# File 'lib/flipper/feature_check_context.rb', line 35 def percentage_of_actors_value values.percentage_of_actors end |
#percentage_of_time_value ⇒ Object
Public: Convenience method for percentage of time value like Feature has.
40 41 42 |
# File 'lib/flipper/feature_check_context.rb', line 40 def percentage_of_time_value values.percentage_of_time end |