Class: BigSitemap::IndexBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/big_sitemap/builder.rb

Constant Summary collapse

HEADER_NAME =
'sitemapindex'
HEADER_ATTRIBUTES =
{
  'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'
}

Constants inherited from Builder

Builder::MAX_URLS

Instance Method Summary collapse

Methods inherited from Builder

#close!, #filepaths!, #initialize, #target!

Constructor Details

This class inherits a constructor from BigSitemap::Builder

Instance Method Details

#add_url!(location, options = {}) ⇒ Object



150
151
152
153
154
155
156
157
# File 'lib/big_sitemap/builder.rb', line 150

def add_url!(location, options={})
  _open_tag 'sitemap'

  tag! 'loc', location
  tag! 'lastmod', options[:last_modified].utc.strftime('%Y-%m-%dT%H:%M:%S+00:00') if options[:last_modified]

  _close_tag 'sitemap'
end