Sha256: 0ff2c9a40be8f09b0d5d264c930c9410329641fc3677444c614c19c6f31d4961

Contents?: true

Size: 760 Bytes

Versions: 6

Compression:

Stored size: 760 Bytes

Contents

module Orthor
  module Collections
    attr_accessor :feeds, :categories, :pages, :static_pages

    def feed(path, name = nil, &block)
      feeds << Orthor::Feed.new(path, name, &block)
    end

    def category(path, name = nil, &block)
      categories << Orthor::Category.new(path, name, &block)
    end

    def page(path, name = nil, &block)
      pages << Orthor::Page.new(path, name, &block)
    end

    def static_page(path, name = nil, &block)
      static_pages << Orthor::StaticPage.new(path, name, &block)
    end 
    
    def resources
      return [] unless @feeds && @pages && @static_pages && @categories
      (@feeds + @pages + @static_pages + @categories + @categories.collect { |category| category.resources }).flatten
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
orthorings-0.1.5 lib/orthor/collections.rb
orthorings-0.1.4 lib/orthor/collections.rb
orthorings-0.1.3 lib/orthor/collections.rb
orthorings-0.1.2 lib/orthor/collections.rb
orthorings-0.1.1 lib/orthor/collections.rb
orthorings-0.1.0 lib/orthor/collections.rb