Class: Locomotive::Liquid::Drops::ProxyCollection

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/locomotive/liquid/drops/proxy_collection.rb

Direct Known Subclasses

ContentTypeProxyCollection

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ ProxyCollection

Returns a new instance of ProxyCollection.



7
8
9
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 7

def initialize(collection)
  @collection = collection
end

Instance Method Details

#allObject



31
32
33
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 31

def all
  self.collection
end

#anyObject



42
43
44
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 42

def any
  self.collection.any?
end

#content_typeObject



46
47
48
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 46

def content_type

end

#countObject Also known as: size, length



27
28
29
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 27

def count
  @count ||= self.collection.count
end

#each(&block) ⇒ Object



19
20
21
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 19

def each(&block)
  self.collection.each(&block)
end

#each_with_index(&block) ⇒ Object



23
24
25
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 23

def each_with_index(&block)
  self.collection.each_with_index(&block)
end

#emptyObject



38
39
40
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 38

def empty
  self.collection.empty?
end

#firstObject



11
12
13
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 11

def first
  self.collection.first
end

#lastObject



15
16
17
# File 'lib/locomotive/liquid/drops/proxy_collection.rb', line 15

def last
  self.collection.last
end