Class: Determinator::Context::Resolver
- Inherits:
-
Object
- Object
- Determinator::Context::Resolver
- Defined in:
- lib/determinator/context/resolver.rb
Instance Attribute Summary collapse
-
#actors ⇒ Object
readonly
Returns the value of attribute actors.
-
#id_path ⇒ Object
readonly
Returns the value of attribute id_path.
Instance Method Summary collapse
- #feature_flag_on?(feature_name) ⇒ Boolean
-
#initialize(actors, controller, id_path, feature: nil) ⇒ Resolver
constructor
A new instance of Resolver.
- #which_variant(feature_name) ⇒ Object
Constructor Details
#initialize(actors, controller, id_path, feature: nil) ⇒ Resolver
Returns a new instance of Resolver.
6 7 8 9 10 11 |
# File 'lib/determinator/context/resolver.rb', line 6 def initialize(actors, controller, id_path, feature: nil) @actors = actors @controller = controller @id_path = id_path @feature = feature end |
Instance Attribute Details
#actors ⇒ Object (readonly)
Returns the value of attribute actors.
4 5 6 |
# File 'lib/determinator/context/resolver.rb', line 4 def actors @actors end |
#id_path ⇒ Object (readonly)
Returns the value of attribute id_path.
4 5 6 |
# File 'lib/determinator/context/resolver.rb', line 4 def id_path @id_path end |
Instance Method Details
#feature_flag_on?(feature_name) ⇒ Boolean
17 18 19 |
# File 'lib/determinator/context/resolver.rb', line 17 def feature_flag_on?(feature_name) controller.feature_flag_on?(feature_name, id: actors.get(id_path), properties: actors.to_params, feature: feature) end |
#which_variant(feature_name) ⇒ Object
13 14 15 |
# File 'lib/determinator/context/resolver.rb', line 13 def which_variant(feature_name) controller.which_variant(feature_name, id: actors.get(id_path), properties: actors.to_params, feature: feature) end |