Class: SitemapGenerator::LinkSet

Inherits:
Object
  • Object
show all
Defined in:
lib/sitemap_generator/link_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLinkSet

Returns a new instance of LinkSet.



5
6
7
# File 'lib/sitemap_generator/link_set.rb', line 5

def initialize
  @links = []
end

Instance Attribute Details

#default_hostObject

Returns the value of attribute default_host.



3
4
5
# File 'lib/sitemap_generator/link_set.rb', line 3

def default_host
  @default_host
end

Returns the value of attribute links.



3
4
5
# File 'lib/sitemap_generator/link_set.rb', line 3

def links
  @links
end

#yahoo_app_idObject

Returns the value of attribute yahoo_app_id.



3
4
5
# File 'lib/sitemap_generator/link_set.rb', line 3

def yahoo_app_id
  @yahoo_app_id
end

Instance Method Details



14
15
16
17
18
# File 'lib/sitemap_generator/link_set.rb', line 14

def add_default_links
  # Add default links
  @links << Link.generate('/', :lastmod => Time.now, :changefreq => 'always', :priority => 1.0)
  @links << Link.generate('/sitemap_index.xml.gz', :lastmod => Time.now, :changefreq => 'always', :priority => 1.0)
end


24
25
26
# File 'lib/sitemap_generator/link_set.rb', line 24

def add_link(link)
  @links << link
end

Yields:



20
21
22
# File 'lib/sitemap_generator/link_set.rb', line 20

def add_links
  yield Mapper.new(self)
end