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.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/kameleoon/configuration/settings.rb', line 19

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

Instance Attribute Details

Returns the value of attribute blocking_behaviour_if_consent_not_given.



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

def blocking_behaviour_if_consent_not_given
  @blocking_behaviour_if_consent_not_given
end

#data_api_domainObject (readonly)

Returns the value of attribute data_api_domain.



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

def data_api_domain
  @data_api_domain
end

Returns the value of attribute is_consent_required.



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

def is_consent_required
  @is_consent_required
end

#real_time_updateObject

Returns the value of attribute real_time_update.



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

def real_time_update
  @real_time_update
end

Instance Method Details

#to_sObject



14
15
16
17
# File 'lib/kameleoon/configuration/settings.rb', line 14

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