Class: Moult::Flags::Snapshot::FlagSet

Inherits:
Struct
  • Object
show all
Defined in:
lib/moult/flags/snapshot.rb

Overview

A normalised snapshot: the provider's state per flag key, plus provenance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



58
59
60
# File 'lib/moult/flags/snapshot.rb', line 58

def source
  @source
end

#statesObject

Returns the value of attribute states

Returns:

  • (Object)

    the current value of states



58
59
60
# File 'lib/moult/flags/snapshot.rb', line 58

def states
  @states
end

Instance Method Details

#key?(flag_key) ⇒ Boolean

Returns whether the provider knows this key.

Returns:

  • (Boolean)

    whether the provider knows this key



60
61
62
# File 'lib/moult/flags/snapshot.rb', line 60

def key?(flag_key)
  states.key?(flag_key)
end

#state_for(flag_key) ⇒ FlagState?

Returns the provider's state for the key, or nil if absent.

Returns:

  • (FlagState, nil)

    the provider's state for the key, or nil if absent



65
66
67
# File 'lib/moult/flags/snapshot.rb', line 65

def state_for(flag_key)
  states[flag_key]
end