Class: Lotus::Action::Cache::LastModified Private
- Inherits:
-
Object
- Object
- Lotus::Action::Cache::LastModified
- Defined in:
- lib/lotus/action/cache/conditional_get.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.
LastModified value object
Instance Method Summary collapse
- #fresh? ⇒ Boolean private
- #header ⇒ Object private
-
#initialize(env, value) ⇒ LastModified
constructor
private
A new instance of LastModified.
Constructor Details
#initialize(env, value) ⇒ LastModified
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 LastModified.
54 55 56 |
# File 'lib/lotus/action/cache/conditional_get.rb', line 54 def initialize(env, value) @env, @value = env, value end |
Instance Method Details
#fresh? ⇒ Boolean
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.
58 59 60 |
# File 'lib/lotus/action/cache/conditional_get.rb', line 58 def fresh? modified_since && Time.httpdate(modified_since).to_i >= @value.to_i end |
#header ⇒ 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.
62 63 64 |
# File 'lib/lotus/action/cache/conditional_get.rb', line 62 def header { LAST_MODIFIED => @value.httpdate } if modified_since end |