Class: SitemapGenerator::Mapper

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

Overview

Generator instances are used to build links. The object passed to the add_links block in config/sitemap.rb is a Generator instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(set) ⇒ Mapper

Returns a new instance of Mapper.



7
8
9
# File 'lib/sitemap_generator/mapper.rb', line 7

def initialize(set)
  @set = set
end

Instance Attribute Details

#setObject

Returns the value of attribute set.



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

def set
  @set
end

Instance Method Details

#add(loc, options = {}) ⇒ Object



11
12
13
# File 'lib/sitemap_generator/mapper.rb', line 11

def add(loc, options = {})
  set.add_link Link.generate(loc, options)
end