Class: Authentication::Logic::Session::MagicColumn::AssignsLastRequestAt Private
- Inherits:
-
Object
- Object
- Authentication::Logic::Session::MagicColumn::AssignsLastRequestAt
- Defined in:
- lib/auth/logic/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 ‘Authentication::Logic::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.
21 22 23 24 25 26 |
# File 'lib/auth/logic/session/magic_column/assigns_last_request_at.rb', line 21 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.
28 29 30 31 32 |
# File 'lib/auth/logic/session/magic_column/assigns_last_request_at.rb', line 28 def assign return unless assign? @record.last_request_at = @current_time end |