class ImageVise::ExpireAfter

Overrides the cache lifetime set in the output headers of the RenderEngine. Can be used to permit the requester to set the caching lifetime, instead of it being a configuration variable in the service performing the rendering

Public Class Methods

new(seconds:) click to toggle source
Calls superclass method
# File lib/image_vise/operators/expire_after.rb, line 5
def initialize(seconds:)
  unless seconds.is_a?(Integer) && seconds > 0
    raise ArgumentError, "the :seconds parameter must be an Integer and must be above 0, but was %s" % seconds.inspect
  end
  super
end

Public Instance Methods

apply!(_, metadata) click to toggle source
# File lib/image_vise/operators/expire_after.rb, line 12
def apply!(_, metadata)
  metadata[:expire_after_seconds] = seconds
end