diff options
author | Krekoten' Marjan <krekoten@gmail.com> | 2010-10-18 00:08:41 +0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-18 00:54:58 +0200 |
commit | 7b2ec381ca5ce88fe62a0a42183b3a5df63ee68b (patch) | |
tree | ad1dac4e376fe2b528503f2eae93ed04afecb152 | |
parent | 0d5d70f1a323efe05f835fce97f7d82fdf198732 (diff) | |
download | rails-7b2ec381ca5ce88fe62a0a42183b3a5df63ee68b.tar.gz rails-7b2ec381ca5ce88fe62a0a42183b3a5df63ee68b.tar.bz2 rails-7b2ec381ca5ce88fe62a0a42183b3a5df63ee68b.zip |
Change def to attr_reader + alias
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | actionpack/lib/action_dispatch/http/cache.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb index 4061222d11..1d2f7e4f19 100644 --- a/actionpack/lib/action_dispatch/http/cache.rb +++ b/actionpack/lib/action_dispatch/http/cache.rb @@ -39,7 +39,8 @@ module ActionDispatch end module Response - attr_reader :cache_control + attr_reader :cache_control, :etag + alias :etag? :etag def initialize(*) status, header, body = super @@ -69,14 +70,6 @@ module ActionDispatch headers['Last-Modified'] = utc_time.httpdate end - def etag - @etag - end - - def etag? - @etag - end - def etag=(etag) key = ActiveSupport::Cache.expand_cache_key(etag) @etag = self["ETag"] = %("#{Digest::MD5.hexdigest(key)}") @@ -99,7 +92,7 @@ module ActionDispatch if control.empty? headers["Cache-Control"] = DEFAULT_CACHE_CONTROL - elsif @cache_control[:no_cache] + elsif control[:no_cache] headers["Cache-Control"] = "no-cache" else extras = control[:extras] |