Class: Hanami::Action::Cache::Expires::Directives Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/action/cache/expires.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.

Class which stores Expires directives

Since:

  • 0.3.0

Instance Method Summary collapse

Constructor Details

#initialize(amount, *values) ⇒ Directives

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 Directives.

Since:

  • 0.3.0



61
62
63
64
# File 'lib/hanami/action/cache/expires.rb', line 61

def initialize(amount, *values)
  @amount = amount
  @cache_control = Hanami::Action::Cache::CacheControl::Directives.new(*(values << {max_age: amount}))
end

Instance Method Details

#headersObject

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



68
69
70
# File 'lib/hanami/action/cache/expires.rb', line 68

def headers
  {Action::EXPIRES => time.httpdate}.merge(@cache_control.headers)
end