Class: AmplitudeExperiment::LocalEvaluationConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/experiment/local/config.rb

Overview

LocalEvaluationConfig

Constant Summary collapse

DEFAULT_SERVER_URL =

Default server url

'https://api.lab.amplitude.com'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_url = DEFAULT_SERVER_URL, bootstrap = {}, flag_config_polling_interval_millis = 30_000, debug: false) ⇒ LocalEvaluationConfig

Returns a new instance of LocalEvaluationConfig.

Parameters:

  • debug (Boolean) (defaults to: false)

    Set to true to log some extra information to the console.

  • server_url (String) (defaults to: DEFAULT_SERVER_URL)

    The server endpoint from which to request variants.

  • bootstrap (Hash) (defaults to: {})

    The value of bootstrap.

  • flag_config_polling_interval_millis (long) (defaults to: 30_000)

    The value of flag config polling interval in million seconds.



27
28
29
30
31
32
33
# File 'lib/experiment/local/config.rb', line 27

def initialize(server_url = DEFAULT_SERVER_URL, bootstrap = {},
               flag_config_polling_interval_millis = 30_000, debug: false)
  @debug = debug || false
  @server_url = server_url
  @bootstrap = bootstrap
  @flag_config_polling_interval_millis = flag_config_polling_interval_millis
end

Instance Attribute Details

#bootstrapHash

The server endpoint from which to request variants.

Returns:

  • (Hash)

    the value of bootstrap



17
18
19
# File 'lib/experiment/local/config.rb', line 17

def bootstrap
  @bootstrap
end

#debugBoolean

Set to true to log some extra information to the console.

Returns:

  • (Boolean)

    the value of debug



9
10
11
# File 'lib/experiment/local/config.rb', line 9

def debug
  @debug
end

#flag_config_polling_interval_millislong

The server endpoint from which to request variants.

Returns:

  • (long)

    the value of flag config polling interval in million seconds



21
22
23
# File 'lib/experiment/local/config.rb', line 21

def flag_config_polling_interval_millis
  @flag_config_polling_interval_millis
end

#server_urlString

The server endpoint from which to request variants.

Returns:

  • (String)

    the value of server url



13
14
15
# File 'lib/experiment/local/config.rb', line 13

def server_url
  @server_url
end