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_val) ⇒ 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
16 17 18 |
# File 'lib/rollout_ui/feature.rb', line 16 def groups rollout.get(feature_for(name)).groups end |
#groups=(groups) ⇒ Object
28 29 30 31 |
# File 'lib/rollout_ui/feature.rb', line 28 def groups=(groups) self.groups.each { |group| rollout.deactivate_group(name, group) } groups.each { |group| rollout.activate_group(name, group) unless group.to_s.empty? } end |
#percentage ⇒ Object
12 13 14 |
# File 'lib/rollout_ui/feature.rb', line 12 def percentage rollout.get(feature_for(name)).percentage.to_s end |
#percentage=(percentage_val) ⇒ Object
24 25 26 |
# File 'lib/rollout_ui/feature.rb', line 24 def percentage=(percentage_val) rollout.activate_percentage(name, percentage_val.to_i) end |
#user_ids ⇒ Object
20 21 22 |
# File 'lib/rollout_ui/feature.rb', line 20 def user_ids rollout.get(feature_for(name)).users end |