Class: AegisNet::Sitemapper::Sitemap

Inherits:
Object
  • Object
show all
Defined in:
lib/sitemapper/sitemap.rb

Overview

:doc:

Direct Known Subclasses

Urlset

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Sitemap

Returns a new instance of Sitemap.


7
8
9
10
11
12
13
14
# File 'lib/sitemapper/sitemap.rb', line 7

def initialize(options = {})
  options.symbolize_keys!
  options.assert_valid_keys(:changefreq, :lastmod, :loc, :priority)
  @changefreq = options[:changefreq] || "weekly"
  @lastmod    = options[:lastmod]
  @loc        = options[:loc]
  @priority   = options[:priority] || 0.5
end

Instance Attribute Details

#lastmod(lastmod = nil) ⇒ Object (readonly)

Returns the value of attribute lastmod


5
6
7
# File 'lib/sitemapper/sitemap.rb', line 5

def lastmod
  @lastmod
end

#loc(loc = nil) ⇒ Object (readonly)

Returns the value of attribute loc


5
6
7
# File 'lib/sitemapper/sitemap.rb', line 5

def loc
  @loc
end

Instance Method Details

#changefreq(freq = nil) ⇒ Object


16
# File 'lib/sitemapper/sitemap.rb', line 16

def changefreq(freq = nil); freq ? @changefreq = freq : @changefreq;  end

#priority(prio = nil) ⇒ Object


19
# File 'lib/sitemapper/sitemap.rb', line 19

def priority(prio = nil); prio ? @priority = prio : @priority; end