Class: Hanami::Config::Sessions Private
- Inherits:
-
Object
- Object
- Hanami::Config::Sessions
- Defined in:
- lib/hanami/config/sessions.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.
Sessions configuration
Constant Summary collapse
- RACK_NAMESPACE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Ruby namespace for Rack session adapters
'Rack::Session::%s'.freeze
- BLACKLISTED_DOMAINS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Localhost string for detecting localhost host configuration
%w(localhost).freeze
Instance Method Summary collapse
-
#enabled? ⇒ FalseClass, TrueClass
private
Check if the sessions are enabled.
-
#initialize(adapter = nil, options = {}, configuration = nil) ⇒ Sessions
constructor
private
HTTP sessions configuration.
-
#middleware ⇒ Array
private
Returns the Rack middleware and the options.
Constructor Details
#initialize(adapter = nil, options = {}, configuration = nil) ⇒ Sessions
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.
HTTP sessions configuration
36 37 38 39 40 |
# File 'lib/hanami/config/sessions.rb', line 36 def initialize(adapter = nil, = {}, configuration = nil) @adapter = adapter @options = @configuration = configuration end |
Instance Method Details
#enabled? ⇒ FalseClass, TrueClass
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.
Check if the sessions are enabled
48 49 50 |
# File 'lib/hanami/config/sessions.rb', line 48 def enabled? !!@adapter end |
#middleware ⇒ Array
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.
Returns the Rack middleware and the options
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/hanami/config/sessions.rb', line 58 def middleware middleware = case @adapter when Symbol RACK_NAMESPACE % Utils::String.classify(@adapter) else @adapter end [middleware, ] end |