def add(target, opts={})
      raise RuntimeError, 'Only up to 50k records allowed!' if @items.size > 50000
      raise ArgumentError, 'Target required!' if target.nil?
      raise ArgumentError, 'Target is empty!' if target.to_s.strip.empty?

      url = process_target(target)

      if url.length > 2048
        raise ArgumentError, "Target can't be longer than 2,048 characters!"
      end

      opts[:updated] = @created_at unless opts.key?(:updated)
      item = XmlSitemap::Item.new(url, opts)
      @items << item
      item
    end
def add(target, opts={})
      raise RuntimeError, 'Only up to 50k records allowed!' if @items.size > 50000
      raise ArgumentError, 'Target required!' if target.nil?
      raise ArgumentError, 'Target is empty!' if target.to_s.strip.empty?

      url = process_target(target)

      if url.length > 2048
        raise ArgumentError, "Target can't be longer than 2,048 characters!"
      end

      opts[:updated] = @created_at unless opts.key?(:updated)
      item = XmlSitemap::Item.new(url, opts)
      @items << item
      item
    end
Initializa a new Map instance

 domain - Primary domain for the map (required)
 opts   - Map options

 opts[:home]   - Automatic homepage creation. To disable set to false. (default: true)
 opts[:secure] - Force HTTPS for all items. (default: false)
 opts[:time]   - Set default lastmod timestamp for items (default: current time)
 opts[:group]  - Group name for sitemap index. (default: sitemap)
 opts[:root]   - Force all links to fall under the main domain.
                 You can add full urls (not paths) if set to false. (default: true)

 Adds a new item to the map

 target - Path or url
 opts   - Item options

 opts[:updated]       - Lastmod property of the item
 opts[:period]        - Update frequency.
 opts[:priority]      - Item priority.
 opts[:validate_time] - Skip time validation if want to insert raw strings.