Class: FluidFeatures::AppFeatureVersion
- Inherits:
-
Object
- Object
- FluidFeatures::AppFeatureVersion
- Defined in:
- lib/fluidfeatures/app/feature.rb
Constant Summary collapse
- DEFAULT_VERSION_NAME =
"default"
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#feature_name ⇒ Object
Returns the value of attribute feature_name.
-
#version_name ⇒ Object
Returns the value of attribute version_name.
Instance Method Summary collapse
-
#initialize(app, feature_name, version_name = DEFAULT_VERSION_NAME) ⇒ AppFeatureVersion
constructor
A new instance of AppFeatureVersion.
-
#set_enabled_percent(percent) ⇒ Object
This can be used to control how much of your user-base sees a particular feature.
Constructor Details
#initialize(app, feature_name, version_name = DEFAULT_VERSION_NAME) ⇒ AppFeatureVersion
Returns a new instance of AppFeatureVersion.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fluidfeatures/app/feature.rb', line 11 def initialize(app, feature_name, version_name=DEFAULT_VERSION_NAME) raise "app invalid : #{app}" unless app.is_a? FluidFeatures::App raise "feature_name invalid : #{feature_name}" unless feature_name.is_a? String version_name ||= ::FluidFeatures::DEFAULT_VERSION_NAME raise "version_name invalid : #{version_name}" unless version_name.is_a? String @app = app @feature_name = feature_name @version_name = version_name end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
7 8 9 |
# File 'lib/fluidfeatures/app/feature.rb', line 7 def app @app end |
#feature_name ⇒ Object
Returns the value of attribute feature_name.
7 8 9 |
# File 'lib/fluidfeatures/app/feature.rb', line 7 def feature_name @feature_name end |
#version_name ⇒ Object
Returns the value of attribute version_name.
7 8 9 |
# File 'lib/fluidfeatures/app/feature.rb', line 7 def version_name @version_name end |
Instance Method Details
#set_enabled_percent(percent) ⇒ Object
This can be used to control how much of your user-base sees a particular feature. It may be easier to use the dashboard provided at www.fluidfeatures.com/dashboard to manage this.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fluidfeatures/app/feature.rb', line 29 def set_enabled_percent(percent) unless percent.is_a? Numeric and percent >= 0.0 and percent <= 100.0 raise "percent invalid : #{percent}" end app.put("/feature/#{feature_name}/#{version_name}/enabled/percent", { :enabled => { :percent => percent } }) end |