Class: SegmentRules
- Inherits:
-
Object
- Object
- SegmentRules
- Defined in:
- lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb
Overview
SegmentRules model for App Configuration service
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#rollout_configuration ⇒ Object
readonly
Returns the value of attribute rollout_configuration.
-
#rollout_percentage ⇒ Object
readonly
Returns the value of attribute rollout_percentage.
-
#rollout_type ⇒ Object
readonly
Returns the value of attribute rollout_type.
-
#rule_id ⇒ Object
readonly
Returns the value of attribute rule_id.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#get_order ⇒ Integer
Rule order.
-
#get_rollout_percentage ⇒ Integer
Rollout percentage.
-
#get_rules ⇒ Array<Hash>
Rules array.
-
#get_value ⇒ Boolean, ...
Rule value.
-
#initialize(segment_rules) ⇒ SegmentRules
constructor
A new instance of SegmentRules.
Constructor Details
#initialize(segment_rules) ⇒ SegmentRules
Returns a new instance of SegmentRules.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 22 def initialize(segment_rules) require_relative "../internal/constants" @rules = segment_rules[:rules] @rule_id = segment_rules[:rule_id] @value = segment_rules[:value] @order = segment_rules[:order] @rollout_type = segment_rules.key?(:rollout_type) ? segment_rules[:rollout_type] : Constants::MANUAL if segment_rules[:rollout_configuration] @rollout_configuration = segment_rules[:rollout_configuration] else @rollout_percentage = segment_rules.key?(:rollout_percentage) ? segment_rules[:rollout_percentage] : 100 end end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def order @order end |
#rollout_configuration ⇒ Object (readonly)
Returns the value of attribute rollout_configuration.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def rollout_configuration @rollout_configuration end |
#rollout_percentage ⇒ Object (readonly)
Returns the value of attribute rollout_percentage.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def rollout_percentage @rollout_percentage end |
#rollout_type ⇒ Object (readonly)
Returns the value of attribute rollout_type.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def rollout_type @rollout_type end |
#rule_id ⇒ Object (readonly)
Returns the value of attribute rule_id.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def rule_id @rule_id end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def rules @rules end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
19 20 21 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 19 def value @value end |
Instance Method Details
#get_order ⇒ Integer
Returns Rule order.
49 50 51 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 49 def get_order @order end |
#get_rollout_percentage ⇒ Integer
Returns Rollout percentage.
54 55 56 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 54 def get_rollout_percentage @rollout_percentage end |
#get_rules ⇒ Array<Hash>
Returns Rules array.
39 40 41 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 39 def get_rules @rules || [] end |
#get_value ⇒ Boolean, ...
Returns Rule value.
44 45 46 |
# File 'lib/ibm_appconfiguration_ruby_sdk/configurations/models/segment_rules.rb', line 44 def get_value @value || "" end |