Class: LaunchDarkly::Impl::Model::SegmentRule Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/model/segment.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, errors_out = nil) ⇒ SegmentRule

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SegmentRule.

Since:

  • 5.5.0



141
142
143
144
145
146
147
148
149
# File 'lib/ldclient-rb/impl/model/segment.rb', line 141

def initialize(data, errors_out = nil)
  @data = data
  @clauses = (data[:clauses] || []).map do |clause_data|
    Clause.new(clause_data, errors_out)
  end
  @weight = data[:weight]
  @bucket_by = data[:bucketBy]
  @rollout_context_kind = data[:rolloutContextKind]
end

Instance Attribute Details

#bucket_by ⇒ String|nil (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String|nil)

Since:

  • 5.5.0



158
159
160
# File 'lib/ldclient-rb/impl/model/segment.rb', line 158

def bucket_by
  @bucket_by
end

#clauses ⇒ Array<LaunchDarkly::Impl::Model::Clause> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 5.5.0



154
155
156
# File 'lib/ldclient-rb/impl/model/segment.rb', line 154

def clauses
  @clauses
end

#data ⇒ Hash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash)

Since:

  • 5.5.0



152
153
154
# File 'lib/ldclient-rb/impl/model/segment.rb', line 152

def data
  @data
end

#rollout_context_kind ⇒ String|nil (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String|nil)

Since:

  • 5.5.0



160
161
162
# File 'lib/ldclient-rb/impl/model/segment.rb', line 160

def rollout_context_kind
  @rollout_context_kind
end

#weight ⇒ Integer|nil (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Integer|nil)

Since:

  • 5.5.0



156
157
158
# File 'lib/ldclient-rb/impl/model/segment.rb', line 156

def weight
  @weight
end