Class: Datadog::Core::FeatureFlags::ResolutionDetails Private

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/feature_flags.rb,
ext/libdatadog_api/feature_flags.c

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.

Resolution details for a feature flag evaluation Base class is defined in the C extension, with Ruby methods added here

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#value ⇒ Object

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.

Get the resolved value, with JSON parsing for object types

Returns:

  • (Object) —

    The resolved value (parsed from JSON if object type)

Raises:



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/datadog/core/feature_flags.rb', line 30

def value
  return @value if defined?(@value)

  # NOTE: Raw value method call doesn't support memoization right now
  value = raw_value

  # NOTE: Lazy parsing of the JSON is a temporary solution and will be
  #       moved into C extension
  @value = json?(value) ? JSON.parse(value) : value
rescue JSON::ParserError => e
  raise Error, "Failed to parse JSON value: #{e.class}: #{e.message}"
end

Instance Method Details

#allocation_key ⇒ Object



32
# File 'ext/libdatadog_api/feature_flags.c', line 32

static VALUE resolution_details_get_allocation_key(VALUE self);

#error? ⇒ Boolean

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.

Check if the resolution resulted in an error

Returns:

  • (Boolean) —

    True if there was an error



46
47
48
# File 'lib/datadog/core/feature_flags.rb', line 46

def error?
  reason == "ERROR"
end

#error_code ⇒ Object



35
# File 'ext/libdatadog_api/feature_flags.c', line 35

static VALUE resolution_details_get_error_code(VALUE self);

#error_message ⇒ Object



36
# File 'ext/libdatadog_api/feature_flags.c', line 36

static VALUE resolution_details_get_error_message(VALUE self);

#features ⇒ Object



39
# File 'ext/libdatadog_api/feature_flags.c', line 39

static VALUE resolution_details_get_features(VALUE self);

#flag_metadata ⇒ Object



38
# File 'ext/libdatadog_api/feature_flags.c', line 38

static VALUE (VALUE self);

#flag_type ⇒ Object



30
# File 'ext/libdatadog_api/feature_flags.c', line 30

static VALUE resolution_details_get_flag_type(VALUE self);

#log? ⇒ Boolean

Returns:

  • (Boolean)


37
# File 'ext/libdatadog_api/feature_flags.c', line 37

static VALUE resolution_details_get_do_log(VALUE self);

#raw_value ⇒ Object



29
# File 'ext/libdatadog_api/feature_flags.c', line 29

static VALUE resolution_details_get_raw_value(VALUE self);

#reason ⇒ Object



34
# File 'ext/libdatadog_api/feature_flags.c', line 34

static VALUE resolution_details_get_reason(VALUE self);

#serial_id ⇒ Object



33
# File 'ext/libdatadog_api/feature_flags.c', line 33

static VALUE resolution_details_get_serial_id(VALUE self);

#variant ⇒ Object



31
# File 'ext/libdatadog_api/feature_flags.c', line 31

static VALUE resolution_details_get_variant(VALUE self);