Class: Lotus::Action::Cache::ETag Private

Inherits:
Object
  • Object
show all
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.

ETag value object

Since:

  • 0.3.0

Instance Method Summary collapse

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.

Since:

  • 0.3.0



30
31
32
# File 'lib/lotus/action/cache/conditional_get.rb', line 30

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.

Returns:

  • (Boolean)

Since:

  • 0.3.0



34
35
36
# File 'lib/lotus/action/cache/conditional_get.rb', line 34

def fresh?
  none_match && @value == none_match
end

#headerObject

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.

Since:

  • 0.3.0



38
39
40
# File 'lib/lotus/action/cache/conditional_get.rb', line 38

def header
  { ETAG => @value } if none_match
end