Sha256: d3ef084c7c9f7f41e496424d23a71d72a8537e97dd661fc4a0b168f02b8ddd9e
Contents?: true
Size: 1.01 KB
Versions: 9
Compression:
Stored size: 1.01 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 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
9 entries across 9 versions & 1 rubygems