Class: ConvertSdk::BucketedFeature

Inherits:
Struct
  • Object
show all
Defined in:
lib/convert_sdk/bucketed_feature.rb

Overview

A successfully resolved feature — a frozen value object returned when a feature decision is made (the success counterpart to a Sentinel miss).

Implemented as a frozen +Struct+ subclass (NOT +Data.define+, which requires Ruby 3.2; this gem's floor is 3.1). Members are snake_case, aligned to the JS +BucketedFeature+ shape, verified against javascript-sdk/packages/types/src/BucketedFeature.ts and the vendored spec/fixtures/test-config.json feature entity. +status+ holds a FeatureStatus wire value; +variables+ is the feature's variable map.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializevoid

Returns builds the struct then freezes it (immutable value object).



25
26
27
28
# File 'lib/convert_sdk/bucketed_feature.rb', line 25

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#experience_idObject

Returns the value of attribute experience_id

Returns:

  • (Object)

    the current value of experience_id



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def experience_id
  @experience_id
end

#experience_keyObject

Returns the value of attribute experience_key

Returns:

  • (Object)

    the current value of experience_key



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def experience_key
  @experience_key
end

#experience_nameObject

Returns the value of attribute experience_name

Returns:

  • (Object)

    the current value of experience_name



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def experience_name
  @experience_name
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def id
  @id
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def key
  @key
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def name
  @name
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def status
  @status
end

#variablesObject

Returns the value of attribute variables

Returns:

  • (Object)

    the current value of variables



13
14
15
# File 'lib/convert_sdk/bucketed_feature.rb', line 13

def variables
  @variables
end

Instance Method Details

#error?Boolean

Returns always false — a real decision is never a business miss.

Returns:

  • (Boolean)

    always false — a real decision is never a business miss.



31
32
33
# File 'lib/convert_sdk/bucketed_feature.rb', line 31

def error?
  false
end