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, logger) ⇒ SegmentRule

Returns a new instance of SegmentRule.

Since:

  • 5.5.0



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

Returns:

  • (String|nil)

Since:

  • 5.5.0



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

def bucket_by
  @bucket_by
end

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

Returns:

Since:

  • 5.5.0



114
115
116
# File 'lib/ldclient-rb/impl/model/segment.rb', line 114

def clauses
  @clauses
end

#dataHash (readonly)

Returns:

  • (Hash)

Since:

  • 5.5.0



112
113
114
# File 'lib/ldclient-rb/impl/model/segment.rb', line 112

def data
  @data
end

#rollout_context_kindString|nil (readonly)

Returns:

  • (String|nil)

Since:

  • 5.5.0



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

def rollout_context_kind
  @rollout_context_kind
end

#weightInteger|nil (readonly)

Returns:

  • (Integer|nil)

Since:

  • 5.5.0



116
117
118
# File 'lib/ldclient-rb/impl/model/segment.rb', line 116

def weight
  @weight
end