Sha256: 8f7bd83701bfc6d6cf0acbb58a718dd396cea92e2bb871ceae0abfa970bfecc0

Contents?: true

Size: 511 Bytes

Versions: 4

Compression:

Stored size: 511 Bytes

Contents

module Padrino
  module Cache
    module Helpers
      module Fragment
        include Padrino::Helpers::OutputHelpers

        def cache(key, opts = nil, &block)
          if self.class.caching?
            if value = self.class.cache_store.get(key)
              concat_content(value)
            else
              value = capture_html(&block)
              self.class.cache_store.set(key, value, opts)
              concat_content(value)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
padrino-cache-0.9.19 lib/padrino-cache/helpers/fragment.rb
padrino-cache-0.9.18 lib/padrino-cache/helpers/fragment.rb
padrino-cache-0.9.17 lib/padrino-cache/helpers/fragment.rb
padrino-cache-0.9.16 lib/padrino-cache/helpers/fragment.rb