Module: ActionDispatch::Http::Cache::Response
- Included in:
- Response
- Defined in:
- lib/action_dispatch/http/cache.rb
Instance Attribute Summary collapse
-
#cache_control ⇒ Object
readonly
Returns the value of attribute cache_control.
-
#etag ⇒ Object
(also: #etag?)
Returns the value of attribute etag.
Instance Method Summary collapse
- #date ⇒ Object
- #date=(utc_time) ⇒ Object
- #date? ⇒ Boolean
- #last_modified ⇒ Object
- #last_modified=(utc_time) ⇒ Object
- #last_modified? ⇒ Boolean
Instance Attribute Details
#cache_control ⇒ Object (readonly)
Returns the value of attribute cache_control.
54 55 56 |
# File 'lib/action_dispatch/http/cache.rb', line 54 def cache_control @cache_control end |
#etag ⇒ Object Also known as: etag?
Returns the value of attribute etag.
54 55 56 |
# File 'lib/action_dispatch/http/cache.rb', line 54 def etag @etag end |
Instance Method Details
#date ⇒ Object
71 72 73 74 75 |
# File 'lib/action_dispatch/http/cache.rb', line 71 def date if date_header = headers['Date'] Time.httpdate(date_header) end end |
#date=(utc_time) ⇒ Object
81 82 83 |
# File 'lib/action_dispatch/http/cache.rb', line 81 def date=(utc_time) headers['Date'] = utc_time.httpdate end |
#date? ⇒ Boolean
77 78 79 |
# File 'lib/action_dispatch/http/cache.rb', line 77 def date? headers.include?('Date') end |
#last_modified ⇒ Object
57 58 59 60 61 |
# File '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) ⇒ Object
67 68 69 |
# File 'lib/action_dispatch/http/cache.rb', line 67 def last_modified=(utc_time) headers[LAST_MODIFIED] = utc_time.httpdate end |
#last_modified? ⇒ Boolean
63 64 65 |
# File 'lib/action_dispatch/http/cache.rb', line 63 def last_modified? headers.include?(LAST_MODIFIED) end |