Sha256: 5f635e68b0ca35751756244072c79cb2366529cb7c908eae17500af444ba47de
Contents?: true
Size: 971 Bytes
Versions: 17
Compression:
Stored size: 971 Bytes
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 alias :size :count alias :length :count def empty self.collection.empty? end def any self.collection.any? 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
17 entries across 17 versions & 2 rubygems