Sha256: 68aa767c40edc74756a7475e9bae15e21400d97338e266d04a1ef54f6522b825

Contents?: true

Size: 496 Bytes

Versions: 48

Compression:

Stored size: 496 Bytes

Contents

module CouchPotato
  module View
    module Lists
      def self.included(base)
        base.send :extend, ClassMethods
      end
      
      module ClassMethods
        def list(name, function)
          lists[name] = function
        end
        
        def lists(name = nil)
          if name.nil?
            @lists ||= {}
          else
            (@lists && @lists[name]) || (superclass.lists(name) if superclass.respond_to?(:lists))
          end
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
couch_potato-1.17.0 lib/couch_potato/view/lists.rb
couch_potato-1.16.0 lib/couch_potato/view/lists.rb
couch_potato-1.15.0 lib/couch_potato/view/lists.rb
couch_potato-1.14.0 lib/couch_potato/view/lists.rb
couch_potato-1.13.0 lib/couch_potato/view/lists.rb
couch_potato-1.12.1 lib/couch_potato/view/lists.rb
couch_potato-1.12.0 lib/couch_potato/view/lists.rb
couch_potato-1.11.0 lib/couch_potato/view/lists.rb
couch_potato-1.10.1 lib/couch_potato/view/lists.rb
couch_potato-1.10.0 lib/couch_potato/view/lists.rb
couch_potato-1.9.0 lib/couch_potato/view/lists.rb
couch_potato-1.7.1 lib/couch_potato/view/lists.rb
couch_potato-1.7.0 lib/couch_potato/view/lists.rb
couch_potato-1.6.5 lib/couch_potato/view/lists.rb
couch_potato-1.6.4 lib/couch_potato/view/lists.rb
couch_potato-1.6.3 lib/couch_potato/view/lists.rb
couch_potato-1.4.0 lib/couch_potato/view/lists.rb
couch_potato-1.3.0 lib/couch_potato/view/lists.rb
couch_potato-1.2.0 lib/couch_potato/view/lists.rb
couch_potato-1.1.4 lib/couch_potato/view/lists.rb