Sha256: 4a165fb2ed06ac1ed35b62c065455aafa56a0d3fe7b6bbbe5ee20ac74d3d6801
Contents?: true
Size: 1.04 KB
Versions: 19
Compression:
Stored size: 1.04 KB
Contents
module Locomotive module Liquid module Drops class ProxyCollection < ::Liquid::Drop def initialize(collection) @collection = collection end def first self.collection.first end def last self.collection.last end def each(&block) self.collection.each(&block) end def each_with_index(&block) self.collection.each_with_index(&block) end def count @count ||= self.collection.count end def all self.collection end alias :size :count alias :length :count def empty self.collection.empty? end def any self.collection.any? end def content_type end protected def paginate(options = {}) @collection = collection.page(options[:page]).per(options[:per_page]) end def collection @collection end end end end end
Version data entries
19 entries across 19 versions & 2 rubygems