Class: StatsigOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/statsig_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment = nil, api_url_base = 'https://statsigapi.net/v1', rulesets_sync_interval: 10, idlists_sync_interval: 60, logging_interval_seconds: 60, logging_max_buffer_size: 1000, local_mode: false, bootstrap_values: nil, rules_updated_callback: nil, data_store: nil) ⇒ StatsigOptions

Returns a new instance of StatsigOptions.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/statsig_options.rb', line 13

def initialize(
  environment=nil,
  api_url_base='https://statsigapi.net/v1',
  rulesets_sync_interval: 10,
  idlists_sync_interval: 60,
  logging_interval_seconds: 60,
  logging_max_buffer_size: 1000,
  local_mode: false,
  bootstrap_values: nil,
  rules_updated_callback: nil,
  data_store: nil)
  @environment = environment.is_a?(Hash) ? environment : nil
  @api_url_base = api_url_base
  @rulesets_sync_interval = rulesets_sync_interval
  @idlists_sync_interval = idlists_sync_interval
  @logging_interval_seconds = logging_interval_seconds
  @logging_max_buffer_size = [logging_max_buffer_size, 1000].min
  @local_mode = local_mode
  @bootstrap_values = bootstrap_values
  @rules_updated_callback = rules_updated_callback
  @data_store = data_store
end

Instance Attribute Details

#api_url_baseObject

Returns the value of attribute api_url_base.



3
4
5
# File 'lib/statsig_options.rb', line 3

def api_url_base
  @api_url_base
end

#bootstrap_valuesObject

Returns the value of attribute bootstrap_values.



9
10
11
# File 'lib/statsig_options.rb', line 9

def bootstrap_values
  @bootstrap_values
end

#data_storeObject

Returns the value of attribute data_store.



11
12
13
# File 'lib/statsig_options.rb', line 11

def data_store
  @data_store
end

#environmentObject

Returns the value of attribute environment.



2
3
4
# File 'lib/statsig_options.rb', line 2

def environment
  @environment
end

#idlists_sync_intervalObject

Returns the value of attribute idlists_sync_interval.



5
6
7
# File 'lib/statsig_options.rb', line 5

def idlists_sync_interval
  @idlists_sync_interval
end

#local_modeObject

Returns the value of attribute local_mode.



8
9
10
# File 'lib/statsig_options.rb', line 8

def local_mode
  @local_mode
end

#logging_interval_secondsObject

Returns the value of attribute logging_interval_seconds.



6
7
8
# File 'lib/statsig_options.rb', line 6

def logging_interval_seconds
  @logging_interval_seconds
end

#logging_max_buffer_sizeObject

Returns the value of attribute logging_max_buffer_size.



7
8
9
# File 'lib/statsig_options.rb', line 7

def logging_max_buffer_size
  @logging_max_buffer_size
end

#rules_updated_callbackObject

Returns the value of attribute rules_updated_callback.



10
11
12
# File 'lib/statsig_options.rb', line 10

def rules_updated_callback
  @rules_updated_callback
end

#rulesets_sync_intervalObject

Returns the value of attribute rulesets_sync_interval.



4
5
6
# File 'lib/statsig_options.rb', line 4

def rulesets_sync_interval
  @rulesets_sync_interval
end