Class: IbmAppconfigurationRubySdk::SegmentRules
- Inherits:
-
Object
- Object
- IbmAppconfigurationRubySdk::SegmentRules
- Defined in:
- lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb
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.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 25 def initialize(segment_rules) @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.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def order @order end |
#rollout_configuration ⇒ Object (readonly)
Returns the value of attribute rollout_configuration.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def rollout_configuration @rollout_configuration end |
#rollout_percentage ⇒ Object (readonly)
Returns the value of attribute rollout_percentage.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def rollout_percentage @rollout_percentage end |
#rollout_type ⇒ Object (readonly)
Returns the value of attribute rollout_type.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def rollout_type @rollout_type end |
#rule_id ⇒ Object (readonly)
Returns the value of attribute rule_id.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def rule_id @rule_id end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def rules @rules end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
22 23 24 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 22 def value @value end |
Instance Method Details
#get_order ⇒ Integer
Returns Rule order.
50 51 52 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 50 def get_order @order end |
#get_rollout_percentage ⇒ Integer
Returns Rollout percentage.
55 56 57 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 55 def get_rollout_percentage @rollout_percentage end |
#get_rules ⇒ Array<Hash>
Returns Rules array.
40 41 42 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 40 def get_rules @rules || [] end |
#get_value ⇒ Boolean, ...
Returns Rule value.
45 46 47 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/segment_rules.rb', line 45 def get_value @value || "" end |