Class: LaunchDarkly::Impl::FlagTracker

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
LaunchDarkly::Interfaces::FlagTracker
Defined in:
lib/ldclient-rb/impl/flag_tracker.rb

Overview

Since:

  • 5.5.0

Defined Under Namespace

Classes: FlagValueChangeAdapter

Instance Method Summary collapse

Methods included from LaunchDarkly::Interfaces::FlagTracker

#add_listener, #remove_listener

Constructor Details

#initialize(broadcaster, eval_fn) ⇒ FlagTracker

Returns a new instance of FlagTracker.

Since:

  • 5.5.0



13
14
15
16
# File 'lib/ldclient-rb/impl/flag_tracker.rb', line 13

def initialize(broadcaster, eval_fn)
  @broadcaster = broadcaster
  @eval_fn = eval_fn
end

Instance Method Details

#add_flag_value_change_listener(key, context, listener) ⇒ Object

Since:

  • 5.5.0



18
19
20
21
22
23
# File 'lib/ldclient-rb/impl/flag_tracker.rb', line 18

def add_flag_value_change_listener(key, context, listener)
  flag_change_listener = FlagValueChangeAdapter.new(key, context, listener, @eval_fn)
  add_listener(flag_change_listener)

  flag_change_listener
end