Class: LaunchDarkly::Impl::DataSystem::DataAvailability Private

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

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.

Represents the availability of data in the SDK.

Since:

  • 5.5.0

Constant Summary collapse

DEFAULTS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

The SDK has no data and will evaluate flags using the application-provided default values.

Since:

  • 5.5.0

:defaults
CACHED =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

The SDK has data, not necessarily the latest, which will be used to evaluate flags.

Since:

  • 5.5.0

:cached
REFRESHED =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

The SDK has obtained, at least once, the latest known data from LaunchDarkly.

Since:

  • 5.5.0

:refreshed
ALL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

[DEFAULTS, CACHED, REFRESHED].freeze

Class Method Summary collapse

Class Method Details

.at_least?(self_level, other) ⇒ 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.

Returns whether this availability level is **at least** as good as the other.

Parameters:

  • self_level (Symbol)

    The current availability level

  • other (Symbol)

    The other availability level to compare against

Returns:

  • (Boolean)

    true if this availability level is at least as good as the other

Since:

  • 5.5.0



144
145
146
147
148
149
150
# File 'lib/ldclient-rb/impl/data_system.rb', line 144

def self.at_least?(self_level, other)
  return true if self_level == other
  return true if self_level == REFRESHED
  return true if self_level == CACHED && other == DEFAULTS

  false
end