Class: Genit::Sitemap

Inherits:
Object
  • Object
show all
Defined in:
lib/genit/documents/sitemap.rb

Overview

Build an XML sitemap.

Instance Method Summary collapse

Constructor Details

#initialize(urls) ⇒ Sitemap

Public: Constructor.

urls - an Array of all the URLs to include in the sitemap.



11
12
13
# File 'lib/genit/documents/sitemap.rb', line 11

def initialize urls
  @builder = Sitemap.builder urls
end

Instance Method Details

#getObject

Public: Get the sitemap

Returns the sitemap as a String.



18
19
20
# File 'lib/genit/documents/sitemap.rb', line 18

def get
  @builder.to_xml
end