Skip to content

Commit

Permalink
Change def to attr_reader + alias
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
krekoten authored and josevalim committed Oct 17, 2010
1 parent 0d5d70f commit 7b2ec38
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions actionpack/lib/action_dispatch/http/cache.rb
Expand Up @@ -39,7 +39,8 @@ def fresh?(response)
end

module Response
attr_reader :cache_control
attr_reader :cache_control, :etag
alias :etag? :etag

def initialize(*)
status, header, body = super
Expand Down Expand Up @@ -69,14 +70,6 @@ def last_modified=(utc_time)
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)}")
Expand All @@ -99,7 +92,7 @@ def set_conditional_cache_control!

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]
Expand Down

0 comments on commit 7b2ec38

Please sign in to comment.