Sha256: 5728c9be8cb8167a8b252a07a2aa614da534ea7e0fde13c3cbc5c2eb2e8bea6e
Contents?: true
Size: 819 Bytes
Versions: 16
Compression:
Stored size: 819 Bytes
Contents
require 'builder' module SitemapGenerator module Builder class SitemapIndexUrl < SitemapUrl def initialize(path, options={}) if index = path.is_a?(SitemapGenerator::Builder::SitemapIndexFile) && path options.reverse_merge!(:host => index.location.host, :lastmod => Time.now, :changefreq => 'always', :priority => 1.0) path = index.location.path_in_public super(path, options) else super end end # Return the URL as XML def to_xml(builder=nil) builder = ::Builder::XmlMarkup.new if builder.nil? builder.sitemap do builder.loc self[:loc] builder.lastmod w3c_date(self[:lastmod]) if self[:lastmod] end builder << '' # force to string end end end end
Version data entries
16 entries across 16 versions & 1 rubygems