Class: ConfigCat::ConfigCatOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url: nil, polling_mode: PollingMode.auto_poll(), config_cache: nil, proxy_address: nil, proxy_port: nil, proxy_user: nil, proxy_pass: nil, open_timeout_seconds: 10, read_timeout_seconds: 30, flag_overrides: nil, data_governance: DataGovernance::GLOBAL, default_user: nil, hooks: nil, offline: false) ⇒ ConfigCatOptions

Returns a new instance of ConfigCatOptions.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/configcat/configcatoptions.rb', line 93

def initialize(base_url: nil,
               polling_mode: PollingMode.auto_poll(),
               config_cache: nil,
               proxy_address: nil,
               proxy_port: nil,
               proxy_user: nil,
               proxy_pass: nil,
               open_timeout_seconds: 10,
               read_timeout_seconds: 30,
               flag_overrides: nil,
               data_governance: DataGovernance::GLOBAL,
               default_user: nil,
               hooks: nil,
               offline: false)
  # The base ConfigCat CDN url.
  @base_url = base_url

  # The polling mode.
  @polling_mode = polling_mode

  # The cache implementation used to cache the downloaded config files.
  @config_cache = config_cache

  # Proxy address
  @proxy_address = proxy_address

  # Proxy port
  @proxy_port = proxy_port

  # username for proxy authentication
  @proxy_user = proxy_user

  # password for proxy authentication
  @proxy_pass = proxy_pass

  # The number of seconds to wait for the server to make the initial connection
  # (i.e. completing the TCP connection handshake).
  @open_timeout_seconds = open_timeout_seconds

  # The number of seconds to wait for the server to respond before giving up.
  @read_timeout_seconds = read_timeout_seconds

  # Feature flag and setting overrides.
  @flag_overrides = flag_overrides

  # Default: `DataGovernance.Global`. Set this parameter to be in sync with the
  # Data Governance preference on the [Dashboard](https://app.configcat.com/organization/data-governance).
  # (Only Organization Admins have access)
  @data_governance = data_governance

  # The default user to be used for evaluating feature flags and getting settings.
  @default_user = default_user

  # The Hooks instance to subscribe to events.
  @hooks = hooks

  # Indicates whether the client should work in offline mode.
  @offline = offline
end

Instance Attribute Details

#base_urlObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def base_url
  @base_url
end

#config_cacheObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def config_cache
  @config_cache
end

#data_governanceObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def data_governance
  @data_governance
end

#default_userObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def default_user
  @default_user
end

#flag_overridesObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def flag_overrides
  @flag_overrides
end

#hooksObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def hooks
  @hooks
end

#offlineObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def offline
  @offline
end

#open_timeout_secondsObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def open_timeout_seconds
  @open_timeout_seconds
end

#polling_modeObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def polling_mode
  @polling_mode
end

#proxy_addressObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def proxy_address
  @proxy_address
end

#proxy_passObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def proxy_pass
  @proxy_pass
end

#proxy_portObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def proxy_port
  @proxy_port
end

#proxy_userObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def proxy_user
  @proxy_user
end

#read_timeout_secondsObject (readonly)

Configuration options for ConfigCatClient.



89
90
91
# File 'lib/configcat/configcatoptions.rb', line 89

def read_timeout_seconds
  @read_timeout_seconds
end