Class: LaunchDarkly::Impl::Model::SegmentRule
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Model::SegmentRule
- Defined in:
- lib/ldclient-rb/impl/model/segment.rb
Overview
Instance Attribute Summary collapse
- #bucket_by ⇒ String|nil readonly
- #clauses ⇒ Array<LaunchDarkly::Impl::Model::Clause> readonly
- #data ⇒ Hash readonly
- #rollout_context_kind ⇒ String|nil readonly
- #weight ⇒ Integer|nil readonly
Instance Method Summary collapse
-
#initialize(data, logger) ⇒ SegmentRule
constructor
A new instance of SegmentRule.
Constructor Details
#initialize(data, logger) ⇒ SegmentRule
Returns a new instance of SegmentRule.
101 102 103 104 105 106 107 108 109 |
# File 'lib/ldclient-rb/impl/model/segment.rb', line 101 def initialize(data, logger) @data = data @clauses = (data[:clauses] || []).map do |clause_data| Clause.new(clause_data, logger) end @weight = data[:weight] @bucket_by = data[:bucketBy] @rollout_context_kind = data[:rolloutContextKind] end |
Instance Attribute Details
#bucket_by ⇒ String|nil (readonly)
118 119 120 |
# File 'lib/ldclient-rb/impl/model/segment.rb', line 118 def bucket_by @bucket_by end |
#clauses ⇒ Array<LaunchDarkly::Impl::Model::Clause> (readonly)
114 115 116 |
# File 'lib/ldclient-rb/impl/model/segment.rb', line 114 def clauses @clauses end |
#data ⇒ Hash (readonly)
112 113 114 |
# File 'lib/ldclient-rb/impl/model/segment.rb', line 112 def data @data end |
#rollout_context_kind ⇒ String|nil (readonly)
120 121 122 |
# File 'lib/ldclient-rb/impl/model/segment.rb', line 120 def rollout_context_kind @rollout_context_kind end |
#weight ⇒ Integer|nil (readonly)
116 117 118 |
# File 'lib/ldclient-rb/impl/model/segment.rb', line 116 def weight @weight end |