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

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

Overview

Represents the availability of data in the SDK.

Since:

  • 5.5.0

Constant Summary collapse

DEFAULTS =

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

Since:

  • 5.5.0

:defaults
CACHED =

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

Since:

  • 5.5.0

:cached
REFRESHED =

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

Since:

  • 5.5.0

:refreshed
ALL =

Since:

  • 5.5.0

[DEFAULTS, CACHED, REFRESHED].freeze

Class Method Summary collapse

Class Method Details

.at_least?(self_level, other) ⇒ Boolean

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