123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: actionpack/lib/action_dispatch/http/cache.rb

Constant Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#cache_control (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 54

attr_reader :cache_control, :etag

#date (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 71

def date
  if date_header = headers[DATE]
    Time.httpdate(date_header)
  end
end

#date=(utc_time) (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 81

def date=(utc_time)
  headers[DATE] = utc_time.httpdate
end

#date?Boolean (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 77

def date?
  headers.include?(DATE)
end

#etag=(etag) (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 85

def etag=(etag)
  key = ActiveSupport::Cache.expand_cache_key(etag)
  @etag = self[ETAG] = %("#{Digest::MD5.hexdigest(key)}")
end

#etag? (rw)

Alias for #etag.

[ GitHub ]

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

alias :etag? :etag

#last_modified (rw)

[ GitHub ]

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

def last_modified
  if last = headers[LAST_MODIFIED]
    Time.httpdate(last)
  end
end

#last_modified=(utc_time) (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 67

def last_modified=(utc_time)
  headers[LAST_MODIFIED] = utc_time.httpdate
end

#last_modified?Boolean (rw)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 63

def last_modified?
  headers.include?(LAST_MODIFIED)
end

Instance Method Details

#etag (rw) Also known as: #etag?

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 54

attr_reader :cache_control, :etag