Class: SimpleSession::Base::OptionHash
- Inherits:
-
Object
- Object
- SimpleSession::Base::OptionHash
- Defined in:
- lib/simple_session/base.rb
Constant Summary collapse
- SANITATION =
[:key, :secret, :options_key]
Instance Method Summary collapse
-
#initialize(args) ⇒ OptionHash
constructor
A new instance of OptionHash.
- #opts ⇒ Object
- #p_time ⇒ Object
- #process_request_options ⇒ Object
- #sanitize_opts ⇒ Object
Constructor Details
#initialize(args) ⇒ OptionHash
181 182 183 184 185 |
# File 'lib/simple_session/base.rb', line 181 def initialize args @opts = args sanitize_opts end |
Instance Method Details
#opts ⇒ Object
187 188 189 |
# File 'lib/simple_session/base.rb', line 187 def opts @opts end |
#p_time ⇒ Object
203 204 205 206 |
# File 'lib/simple_session/base.rb', line 203 def p_time time = Time.now + @opts[:max_age].to_i @opts[:expires] = time if @opts[:max_age] end |
#process_request_options ⇒ Object
195 196 197 198 199 200 201 |
# File 'lib/simple_session/base.rb', line 195 def begin p_time rescue => e puts e. end end |
#sanitize_opts ⇒ Object
191 192 193 |
# File 'lib/simple_session/base.rb', line 191 def sanitize_opts @opts = sanitize @opts end |