Sha256: 9e1f65fb5ac0e0b297827fa5a2f059bf7e8925ec2e0407c9898adb475d4b9a8c

Contents?: true

Size: 770 Bytes

Versions: 2

Compression:

Stored size: 770 Bytes

Contents

module DynamicSitemaps
  class Sitemap
    attr_reader :name, :collection, :block, :host, :folder

    # Initializes a sitemap object.
    # 
    #   Sitemap.new(:site) do
    #     url root_url
    #   end
    def initialize(*args, &block)
      if args.first.is_a?(Symbol)
        @name = args.shift
      end

      if args.last.is_a?(Hash)
        options = args.pop
        @per_page = options[:per_page]
        @host = options[:host]
        @folder = options[:folder]
        @collection = options[:collection]
      end

      @block = block
    end

    def root_url
      "http://#{host}"
    end

    def per_page
      @per_page ||= DynamicSitemaps.per_page
    end

    # Generates sitemap XML files based on this sitemap
    def generate
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dynamic_sitemaps-2.0.0 lib/dynamic_sitemaps/sitemap.rb
dynamic_sitemaps-2.0.0.beta2 lib/dynamic_sitemaps/sitemap.rb