class StaleOptions::ArrayOptions

Protected Instance Methods

etag() click to toggle source
# File lib/stale_options/array_options.rb, line 13
def etag
  cache_by_itself? ? object_hash(@record) : collection_hash(@record)
end
last_modified() click to toggle source
# File lib/stale_options/array_options.rb, line 17
def last_modified
  read_last_modified(most_recent) if most_recent
end

Private Instance Methods

most_recent() click to toggle source
# File lib/stale_options/array_options.rb, line 5
def most_recent
  @most_recent ||= @record.max do |a, b|
    read_last_modified(a) <=> read_last_modified(b)
  end
end