Module: ActionDispatch::Http::Cache::Response

Included in:
Response
Defined in:
actionpack/lib/action_dispatch/http/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_controlObject (readonly)

Returns the value of attribute cache_control



42
43
44
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 42

def cache_control
  @cache_control
end

#etagObject Also known as: etag?

Returns the value of attribute etag



42
43
44
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 42

def etag
  @etag
end

Instance Method Details

#last_modifiedObject



45
46
47
48
49
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 45

def last_modified
  if last = headers['Last-Modified']
    Time.httpdate(last)
  end
end

#last_modified=(utc_time) ⇒ Object



55
56
57
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 55

def last_modified=(utc_time)
  headers['Last-Modified'] = utc_time.httpdate
end

#last_modified?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 51

def last_modified?
  headers.include?('Last-Modified')
end