Class: Locomotive::Steam::Liquid::Drops::ProxyCollection
Instance Method Summary
collapse
Methods included from Scopeable
#_apply_scope_order, #apply_scope
#mounting_point, #site
Constructor Details
Returns a new instance of ProxyCollection.
18
19
20
21
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 18
def initialize(content_type)
@content_type = content_type
@collection = nil
end
|
Instance Method Details
#all ⇒ Object
23
24
25
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 23
def all
self.collection
end
|
#any ⇒ Object
27
28
29
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 27
def any
self.collection.any?
end
|
#api ⇒ Object
54
55
56
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 54
def api
{ 'create' => "/entry_submissions/#{@content_type.slug}" }
end
|
#before_method(meth) ⇒ Object
58
59
60
61
62
63
64
65
66
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 58
def before_method(meth)
if (meth.to_s =~ /^group_by_(.+)$/) == 0
self.group_entries_by(@content_type, $1)
elsif (meth.to_s =~ /^(.+)_options$/) == 0
self.select_options_for(@content_type, $1)
else
@content_type.send(meth)
end
end
|
#each(&block) ⇒ Object
46
47
48
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 46
def each(&block)
self.collection.each(&block)
end
|
#first ⇒ Object
31
32
33
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 31
def first
self.collection.first
end
|
#last ⇒ Object
35
36
37
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 35
def last
self.collection.last
end
|
#public_submission_url ⇒ Object
50
51
52
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 50
def public_submission_url
"/entry_submissions/#{@content_type.slug}"
end
|
#size ⇒ Object
Also known as:
length, count
39
40
41
|
# File 'lib/locomotive/steam/liquid/drops/content_types.rb', line 39
def size
self.collection.size
end
|