Class: Lotus::Config::Cookies Private
- Inherits:
-
Object
- Object
- Lotus::Config::Cookies
- Defined in:
- lib/lotus/config/cookies.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Cookies configuration
Instance Attribute Summary collapse
-
#default_options ⇒ Hash
readonly
private
Return the routes for this application.
Instance Method Summary collapse
-
#enabled? ⇒ TrueClass, FalseClass
private
Return if cookies are enabled.
-
#initialize(configuration, options = {}) ⇒ Cookies
constructor
private
Cookies configuration.
Constructor Details
#initialize(configuration, options = {}) ⇒ Cookies
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Cookies configuration
httponly option enabled by default. Prevent attackers to steal cookies via JavaScript, Eg. alert(document.cookie) will fail
51 52 53 54 55 |
# File 'lib/lotus/config/cookies.rb', line 51 def initialize(configuration, = {}) @options = @default_options = { httponly: true, secure: configuration.ssl? } @default_options.merge!() if .is_a?(::Hash) end |
Instance Attribute Details
#default_options ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the routes for this application
15 16 17 |
# File 'lib/lotus/config/cookies.rb', line 15 def @default_options end |
Instance Method Details
#enabled? ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return if cookies are enabled
63 64 65 |
# File 'lib/lotus/config/cookies.rb', line 63 def enabled? @options.respond_to?(:empty?) ? !@options.empty? : !!@options end |