Class: ConfigBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/ff/ruby/server/sdk/api/config_builder.rb

Instance Method Summary collapse

Constructor Details

#initializeConfigBuilder

Returns a new instance of ConfigBuilder.



8
9
10
11
12
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 8

def initialize

  @config = Config.new
  @config.cache = DefaultCache.new(@config.logger)
end

Instance Method Details

#all_attributes_private(all_attributes_private) ⇒ Object



56
57
58
59
60
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 56

def all_attributes_private(all_attributes_private)

  @config.all_attributes_private = all_attributes_private
  self
end

#analytics_enabled(analytics_enabled) ⇒ Object



38
39
40
41
42
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 38

def analytics_enabled(analytics_enabled)

  @config.analytics_enabled = analytics_enabled
  self
end

#buffer_size(buffer_size) ⇒ Object



50
51
52
53
54
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 50

def buffer_size(buffer_size)

  @config.buffer_size = buffer_size
  self
end

#buildObject



3
4
5
6
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 3

def build

  @config
end

#cache(cache) ⇒ Object



110
111
112
113
114
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 110

def cache(cache)

  @config.cache = cache
  self
end

#config_url(config_url) ⇒ Object



14
15
16
17
18
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 14

def config_url(config_url)

  @config.config_url = config_url
  self
end

#connection_timeout(connection_timeout) ⇒ Object



68
69
70
71
72
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 68

def connection_timeout(connection_timeout)

  @config.connection_timeout = connection_timeout
  self
end

#debugging(debug) ⇒ Object



98
99
100
101
102
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 98

def debugging(debug)

  @config.debugging = debug
  self
end

#event_url(event_url) ⇒ Object



20
21
22
23
24
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 20

def event_url(event_url)

  @config.event_url = event_url
  self
end

#frequency(frequency) ⇒ Object



44
45
46
47
48
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 44

def frequency(frequency)

  @config.frequency = frequency
  self
end

#logger(logger) ⇒ Object



91
92
93
94
95
96
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 91

def logger(logger)

  @config.logger = logger
  @config.cache.logger = logger
  self
end

#metrics_service_acceptable_duration(metrics_service_acceptable_duration) ⇒ Object



104
105
106
107
108
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 104

def metrics_service_acceptable_duration(metrics_service_acceptable_duration)

  @config.metrics_service_acceptable_duration = metrics_service_acceptable_duration
  self
end

#poll_interval_in_seconds(poll_interval_in_seconds) ⇒ Object



32
33
34
35
36
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 32

def poll_interval_in_seconds(poll_interval_in_seconds)

  @config.poll_interval_in_seconds = poll_interval_in_seconds
  self
end

#private_attributes(private_attributes) ⇒ Object



62
63
64
65
66
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 62

def private_attributes(private_attributes)

  @config.private_attributes = private_attributes
  self
end

#read_timeout(read_timeout) ⇒ Object



74
75
76
77
78
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 74

def read_timeout(read_timeout)

  @config.read_timeout = read_timeout
  self
end

#store(store) ⇒ Object



116
117
118
119
120
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 116

def store(store)

  @config.store = store
  self
end

#stream_enabled(stream_enabled) ⇒ Object



26
27
28
29
30
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 26

def stream_enabled(stream_enabled)

  @config.stream_enabled = stream_enabled
  self
end

#tls_ca_cert(cert_file) ⇒ Object



86
87
88
89
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 86

def tls_ca_cert(cert_file)
  @config.ssl_ca_cert = cert_file
  self
end

#write_timeout(write_timeout) ⇒ Object



80
81
82
83
84
# File 'lib/ff/ruby/server/sdk/api/config_builder.rb', line 80

def write_timeout(write_timeout)

  @config.write_timeout = write_timeout
  self
end