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

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

Constant Summary

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) cache_control (readonly)

Returns the value of attribute cache_control



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

def cache_control
  @cache_control
end

- (Object) etag Also known as: etag?

Returns the value of attribute etag



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

def etag
  @etag
end

Instance Method Details

- (Object) date



71
72
73
74
75
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 71

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

- (Object) date=(utc_time)



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

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

- (Boolean) date?



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

def date?
  headers.include?('Date')
end

- (Object) last_modified



57
58
59
60
61
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 57

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

- (Object) last_modified=(utc_time)



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

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

- (Boolean) last_modified?



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

def last_modified?
  headers.include?(LAST_MODIFIED)
end