Class: RolloutUi::Feature
- Inherits:
-
Object
- Object
- RolloutUi::Feature
- Defined in:
- lib/rollout_ui/feature.rb
Defined Under Namespace
Classes: User
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #groups ⇒ Object
- #groups=(groups) ⇒ Object
-
#initialize(name) ⇒ Feature
constructor
A new instance of Feature.
- #percentage ⇒ Object
- #percentage=(percentage) ⇒ Object
- #user_ids ⇒ Object
- #user_ids=(ids) ⇒ Object
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/rollout_ui/feature.rb', line 5 def name @name end |
Instance Method Details
#groups ⇒ Object
18 19 20 |
# File 'lib/rollout_ui/feature.rb', line 18 def groups redis.smembers(group_key(name)) end |
#groups=(groups) ⇒ Object
30 31 32 33 |
# File 'lib/rollout_ui/feature.rb', line 30 def groups=(groups) redis.del(group_key(name)) groups.each { |group| rollout.activate_group(name, group) unless group.to_s.empty? } end |
#percentage ⇒ Object
14 15 16 |
# File 'lib/rollout_ui/feature.rb', line 14 def percentage redis.get(percentage_key(name)) end |
#percentage=(percentage) ⇒ Object
26 27 28 |
# File 'lib/rollout_ui/feature.rb', line 26 def percentage=(percentage) rollout.activate_percentage(name, percentage) end |
#user_ids ⇒ Object
22 23 24 |
# File 'lib/rollout_ui/feature.rb', line 22 def user_ids redis.smembers(user_key(name)) end |