Class: Kameleoon::Configuration::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/configuration/settings.rb

Overview

KameleoonConfigurationSettings is used for saving setting’s parameters, e.g state of real time update for site code and etc

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = nil) ⇒ Settings

Returns a new instance of Settings.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/kameleoon/configuration/settings.rb', line 17

def initialize(configuration = nil)
  if configuration.nil?
    @real_time_update = false
    @is_consent_required = false
    @data_api_domain = nil
  else
    @real_time_update = configuration['realTimeUpdate'] || false
    @is_consent_required = configuration['consentType'] == 'REQUIRED'
    @data_api_domain = configuration['dataApiDomain']
  end
end

Instance Attribute Details

#data_api_domainObject (readonly)

Returns the value of attribute data_api_domain.



10
11
12
# File 'lib/kameleoon/configuration/settings.rb', line 10

def data_api_domain
  @data_api_domain
end

Returns the value of attribute is_consent_required.



10
11
12
# File 'lib/kameleoon/configuration/settings.rb', line 10

def is_consent_required
  @is_consent_required
end

#real_time_updateObject

Returns the value of attribute real_time_update.



9
10
11
# File 'lib/kameleoon/configuration/settings.rb', line 9

def real_time_update
  @real_time_update
end

Instance Method Details

#to_sObject



12
13
14
15
# File 'lib/kameleoon/configuration/settings.rb', line 12

def to_s
  "Settings{real_time_update:#{@real_time_update},is_consent_required:#{@is_consent_required}," \
    "data_api_domain:#{@data_api_domain}}"
end