Class: SecureHeaders::CookiesConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/secure_headers/utils/cookies_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ CookiesConfig

Returns a new instance of CookiesConfig.



7
8
9
# File 'lib/secure_headers/utils/cookies_config.rb', line 7

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/secure_headers/utils/cookies_config.rb', line 5

def config
  @config
end

Instance Method Details

#validate!Object



11
12
13
14
15
16
17
18
# File 'lib/secure_headers/utils/cookies_config.rb', line 11

def validate!
  return if config.nil? || config == SecureHeaders::OPT_OUT

  validate_config!
  validate_secure_config! unless config[:secure].nil?
  validate_httponly_config! unless config[:httponly].nil?
  validate_samesite_config! unless config[:samesite].nil?
end