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

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

Overview

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, errors_out = nil) ⇒ SegmentRule

Returns a new instance of SegmentRule.

Since:

  • 5.5.0



107
108
109
110
111
112
113
114
115
# File 'lib/ldclient-rb/impl/model/segment.rb', line 107

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_byString|nil (readonly)

Returns:

  • (String|nil)

Since:

  • 5.5.0



124
125
126
# File 'lib/ldclient-rb/impl/model/segment.rb', line 124

def bucket_by
  @bucket_by
end

#clausesArray<LaunchDarkly::Impl::Model::Clause> (readonly)

Returns:

Since:

  • 5.5.0



120
121
122
# File 'lib/ldclient-rb/impl/model/segment.rb', line 120

def clauses
  @clauses
end

#dataHash (readonly)

Returns:

  • (Hash)

Since:

  • 5.5.0



118
119
120
# File 'lib/ldclient-rb/impl/model/segment.rb', line 118

def data
  @data
end

#rollout_context_kindString|nil (readonly)

Returns:

  • (String|nil)

Since:

  • 5.5.0



126
127
128
# File 'lib/ldclient-rb/impl/model/segment.rb', line 126

def rollout_context_kind
  @rollout_context_kind
end

#weightInteger|nil (readonly)

Returns:

  • (Integer|nil)

Since:

  • 5.5.0



122
123
124
# File 'lib/ldclient-rb/impl/model/segment.rb', line 122

def weight
  @weight
end