Module: SpreeSitemapGenerator::SpreeDefaults
- Defined in:
- lib/spree_sitemap_generator/spree_defaults.rb
Instance Method Summary collapse
- #add_account(options = {}) ⇒ Object
- #add_login(options = {}) ⇒ Object
- #add_password_reset(options = {}) ⇒ Object
- #add_products(options = {}) ⇒ Object
- #add_signup(options = {}) ⇒ Object
- #add_taxon(taxon, options = {}) ⇒ Object
- #add_taxons(options = {}) ⇒ Object
- #default_url_options ⇒ Object
Instance Method Details
#add_account(options = {}) ⇒ Object
15 16 17 |
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 15 def add_account(={}) add(account_path, ) end |
#add_login(options = {}) ⇒ Object
7 8 9 |
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 7 def add_login(={}) add(login_path, ) end |
#add_password_reset(options = {}) ⇒ Object
19 20 21 |
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 19 def add_password_reset(={}) add(new_user_password_path, ) 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(={}) active_products = Product.active add(products_path, .merge(:lastmod => active_products.last_updated)) active_products.each do |product| add(product_path(product), .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 add_signup(={}) add(signup_path, ) end |
#add_taxon(taxon, options = {}) ⇒ Object
36 37 38 39 |
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 36 def add_taxon(taxon, ={}) add(nested_taxons_path(taxon.permalink), .merge(:lastmod => taxon.products.last_updated)) taxon.children.each {|child| add_taxon(child, ) } end |
#add_taxons(options = {}) ⇒ Object
32 33 34 |
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 32 def add_taxons(={}) Taxon.roots.each {|taxon| add_taxon(taxon, ) } end |
#default_url_options ⇒ Object
2 3 4 |
# File 'lib/spree_sitemap_generator/spree_defaults.rb', line 2 def {:host => SitemapGenerator::Sitemap.default_host} end |