lib/protocol/http/header/cache_control.rb in protocol-http-0.14.0 vs lib/protocol/http/header/cache_control.rb in protocol-http-0.14.1
- old
+ new
@@ -27,10 +27,12 @@
module Header
# Header value which is split by newline charaters (e.g. cookies).
class CacheControl < Split
PRIVATE = 'private'
PUBLIC = 'public'
+ NO_CACHE = 'no-cache'
+ NO_STORE = 'no-store'
MAX_AGE = 'max-age'
def initialize(value)
super(value.downcase)
end
@@ -43,9 +45,17 @@
self.include?(PRIVATE)
end
def public?
self.include?(PUBLIC)
+ end
+
+ def no_cache?
+ self.include?(NO_CACHE)
+ end
+
+ def no_store?
+ self.include?(NO_STORE)
end
def max_age
if value = self.find{|value| value.start_with?(MAX_AGE)}
_, age = value.split('=', 2)