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

#valueObject

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}"
end

Instance Method Details

#allocation_keyObject



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

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_codeObject



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

static VALUE resolution_details_get_error_code(VALUE self);

#error_messageObject



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

static VALUE resolution_details_get_error_message(VALUE self);

#flag_metadataObject



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

static VALUE (VALUE self);

#flag_typeObject



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

static VALUE resolution_details_get_flag_type(VALUE self);

#log?Boolean

Returns:

  • (Boolean)


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

static VALUE resolution_details_get_do_log(VALUE self);

#raw_valueObject



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

static VALUE resolution_details_get_raw_value(VALUE self);

#reasonObject



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

static VALUE resolution_details_get_reason(VALUE self);

#variantObject



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

static VALUE resolution_details_get_variant(VALUE self);