Class: SecureHeaders::CookiesConfig
- Inherits:
-
Object
- Object
- SecureHeaders::CookiesConfig
- Defined in:
- lib/secure_headers/utils/cookies_config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ CookiesConfig
constructor
A new instance of CookiesConfig.
- #validate! ⇒ Object
Constructor Details
#initialize(config) ⇒ CookiesConfig
Returns a new instance of CookiesConfig.
6 7 8 |
# File 'lib/secure_headers/utils/cookies_config.rb', line 6 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/secure_headers/utils/cookies_config.rb', line 4 def config @config end |
Instance Method Details
#validate! ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/secure_headers/utils/cookies_config.rb', line 10 def validate! return if config.nil? || config == SecureHeaders::OPT_OUT validate_config! validate_secure_config! if config[:secure] validate_httponly_config! if config[:httponly] validate_samesite_config! if config[:samesite] end |