Class: Authlogic::Session::MagicColumn::AssignsLastRequestAt Private
- Inherits:
-
Object
- Object
- Authlogic::Session::MagicColumn::AssignsLastRequestAt
- Defined in:
- lib/authlogic/session/magic_column/assigns_last_request_at.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.
Assigns the current time to the ‘last_request_at` attribute.
-
The ‘last_request_at` column must exist
-
Assignment can be disabled on a per-controller basis
-
Assignment will not happen more often than ‘last_request_at_threshold`
seconds.
-
current_time - a ‘Time`
-
record - eg. a ‘User`
-
controller - an ‘Authlogic::ControllerAdapters::AbstractAdapter`
-
last_request_at_threshold - integer - seconds
Instance Method Summary collapse
- #assign ⇒ Object private
-
#initialize(current_time, record, controller, last_request_at_threshold) ⇒ AssignsLastRequestAt
constructor
private
A new instance of AssignsLastRequestAt.
Constructor Details
#initialize(current_time, record, controller, last_request_at_threshold) ⇒ AssignsLastRequestAt
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 a new instance of AssignsLastRequestAt.
20 21 22 23 24 25 |
# File 'lib/authlogic/session/magic_column/assigns_last_request_at.rb', line 20 def initialize(current_time, record, controller, last_request_at_threshold) @current_time = current_time @record = record @controller = controller @last_request_at_threshold = last_request_at_threshold end |
Instance Method Details
#assign ⇒ Object
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.
27 28 29 30 |
# File 'lib/authlogic/session/magic_column/assigns_last_request_at.rb', line 27 def assign return unless assign? @record.last_request_at = @current_time end |