Module: CouchPotato::View::Lists::ClassMethods

Defined in:
lib/couch_potato/view/lists.rb

Instance Method Summary collapse

Instance Method Details

#list(name, function) ⇒ Object



9
10
11
# File 'lib/couch_potato/view/lists.rb', line 9

def list(name, function)
  lists[name] = function
end

#lists(name = nil) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/couch_potato/view/lists.rb', line 13

def lists(name = nil)
  if name.nil?
    @lists ||= {}
  else
    (@lists && @lists[name]) || (superclass.lists(name) if superclass.respond_to?(:lists))
  end
end