Module: SessionOff::InstanceMethods
- Defined in:
- lib/session_off.rb
Instance Method Summary collapse
- #disable_session ⇒ Object
-
#process_with_session_off(request, response, method = :perform_action, *args) ⇒ Object
Rails 2.3.x.
- #reset_session ⇒ Object
- #session ⇒ Object
- #session_enabled? ⇒ Boolean
Instance Method Details
#disable_session ⇒ Object
160 161 162 |
# File 'lib/session_off.rb', line 160 def disable_session @_session = false end |
#process_with_session_off(request, response, method = :perform_action, *args) ⇒ Object
Rails 2.3.x
192 193 194 195 196 197 198 199 200 201 |
# File 'lib/session_off.rb', line 192 def process_with_session_off(action, *args) = self.class.(request, action) = request. if .is_a?(ActionDispatch::Request::Session::Options) = .instance_variable_get(:@delegate) end .merge! disable_session if [:disabled] process_without_session_off(action, *args) end |
#reset_session ⇒ Object
153 154 155 156 157 158 |
# File 'lib/session_off.rb', line 153 def reset_session if session_enabled? request.reset_session @_session = nil end end |
#session ⇒ Object
149 150 151 |
# File 'lib/session_off.rb', line 149 def session @_session == false ? nil : @_session ||= request.session end |
#session_enabled? ⇒ Boolean
145 146 147 |
# File 'lib/session_off.rb', line 145 def session_enabled? @_session != false end |