Sha256: 1d006d02c72e8e50e15950346d75a97e104bfa6359422f4684a8295b1d4fb6fe

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

module Rtml::Controller::CacheHelpers
  def expires_at(val = nil, &block)
    if val
      @expires_at = proc { val }
    else
      @expires_at = block if block_given?
    end

    if @expires_at
      @expires_at
    else
      if self.class.respond_to?(:expires_at)
        self.class.expires_at
      else
        nil
      end
    end
  end

  def self.included(base)
    base.send(:extend, self)
    base.instance_eval do
      hide_action :expires_at
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rtml-2.0.4 lib/rtml/controller/cache_helpers.rb
rtml-2.0.3 lib/rtml/controller/cache_helpers.rb
rtml-2.0.2 lib/rtml/controller/cache_helpers.rb
rtml-2.0.1 lib/rtml/controller/cache_helpers.rb
rtml-2.0.0.alpha.1 lib/rtml/controller/cache_helpers.rb