# File 'lib/sitemap_generator/builder/sitemap_url.rb', line 33definitialize(path,options={})options=options.dupifsitemap=path.is_a?(SitemapGenerator::Builder::SitemapFile)&&pathSitemapGenerator::Utilities.reverse_merge!(options,:host=>sitemap.location.host,:lastmod=>sitemap.lastmod)path=sitemap.location.path_in_publicendSitemapGenerator::Utilities.assert_valid_keys(options,:priority,:changefreq,:lastmod,:expires,:host,:images,:video,:geo,:news,:videos,:mobile,:alternate,:alternates,:pagemap)SitemapGenerator::Utilities.reverse_merge!(options,:priority=>0.5,:changefreq=>'weekly',:lastmod=>Time.now,:images=>[],:news=>{},:videos=>[],:mobile=>false,:alternates=>[])raise"Cannot generate a url without a host"unlessSitemapGenerator::Utilities.present?(options[:host])ifvideo=options.delete(:video)options[:videos]=video.is_a?(Array)?options[:videos].concat(video):options[:videos]<<videoendifalternate=options.delete(:alternate)options[:alternates]=alternate.is_a?(Array)?options[:alternates].concat(alternate):options[:alternates]<<alternateendpath=path.to_s.sub(/^\//,'')loc=path.empty??options[:host]:(options[:host].to_s.sub(/\/$/,'')+'/'+path)self.merge!(:priority=>options[:priority],:changefreq=>options[:changefreq],:lastmod=>options[:lastmod],:expires=>options[:expires],:host=>options[:host],:loc=>loc,:images=>prepare_images(options[:images],options[:host]),:news=>prepare_news(options[:news]),:videos=>options[:videos],:geo=>options[:geo],:mobile=>options[:mobile],:alternates=>options[:alternates],:pagemap=>options[:pagemap])end