Module: RSS::Atom::DuplicateLinkChecker

Included in:
Entry, Feed, Feed::Entry
Defined in:
lib/rss/atom.rb

Instance Method Summary collapse

Instance Method Details



192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/rss/atom.rb', line 192

def validate_duplicate_links(links)
  link_infos = {}
  links.each do |link|
    rel = link.rel || "alternate"
    next unless rel == "alternate"
    key = [link.hreflang, link.type]
    if link_infos.has_key?(key)
      raise TooMuchTagError.new("link", tag_name)
    end
    link_infos[key] = true
  end
end