Class: MassiveSitemap::Builder::Rotating

Inherits:
Base
  • Object
show all
Defined in:
lib/massive_sitemap/builder/rotating.rb

Constant Summary collapse

NUM_URLS =
1..50_000
OPTS =
Base::OPTS.merge(
  :max_urls => NUM_URLS.max
)

Constants inherited from Base

Base::HEADER_ATTRIBUTES, Base::HEADER_NAME

Instance Method Summary collapse

Methods inherited from Base

#add, #close!, generate, #init_writer!, #initialize

Constructor Details

This class inherits a constructor from MassiveSitemap::Builder::Base

Instance Method Details

#add_url!(location, attrs = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/massive_sitemap/builder/rotating.rb', line 19

def add_url!(location, attrs = {})
  if @urls.to_i >= @options[:max_urls]
    close!
  end
  super
  @urls += 1
end

#header!(&block) ⇒ Object



14
15
16
17
# File 'lib/massive_sitemap/builder/rotating.rb', line 14

def header!(&block)
  @urls  = 0
  super
end