Class: Hanami::Action::Cache::ETag Private
- Inherits:
-
Object
- Object
- Hanami::Action::Cache::ETag
- Defined in:
- lib/hanami/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.
ETag value object
Instance Method Summary collapse
- #fresh? ⇒ Boolean private
- #header ⇒ Object private
-
#initialize(env, value) ⇒ ETag
constructor
private
A new instance of ETag.
Constructor Details
#initialize(env, value) ⇒ ETag
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 ETag.
31 32 33 |
# File 'lib/hanami/action/cache/conditional_get.rb', line 31 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.
37 38 39 |
# File 'lib/hanami/action/cache/conditional_get.rb', line 37 def fresh? none_match && @value == none_match 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.
43 44 45 |
# File 'lib/hanami/action/cache/conditional_get.rb', line 43 def header { ETAG => @value } if @value end |