Module: SpreeSitemapGenerator::SpreeDefaults

Defined in:
lib/spree_sitemap_generator/spree_defaults.rb

Instance Method Summary collapse

Instance Method Details

#add_account(options = {}) ⇒ Object



15
16
17
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 15

def (options={})
  add(, options)
end

#add_login(options = {}) ⇒ Object



7
8
9
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 7

def (options={})
  add(, options)
end

#add_password_reset(options = {}) ⇒ Object



19
20
21
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 19

def add_password_reset(options={})
  add(new_user_password_path, options)
end

#add_products(options = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 23

def add_products(options={})
  active_products = Product.active

  add(products_path, options.merge(:lastmod => active_products.last_updated))
  active_products.each do |product|
    add(product_path(product), options.merge(:lastmod => product.updated_at))
  end 
end

#add_signup(options = {}) ⇒ Object



11
12
13
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 11

def (options={})
  add(, options)
end

#add_taxon(taxon, options = {}) ⇒ Object



36
37
38
39
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 36

def add_taxon(taxon, options={})
  add(nested_taxons_path(taxon.permalink), options.merge(:lastmod => taxon.products.last_updated))
  taxon.children.each {|child| add_taxon(child, options) }
end

#add_taxons(options = {}) ⇒ Object



32
33
34
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 32

def add_taxons(options={})
  Taxon.roots.each {|taxon| add_taxon(taxon, options) }
end

#default_url_optionsObject



2
3
4
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 2

def default_url_options
  {:host => SitemapGenerator::Sitemap.default_host}
end