Module: RichUrls::Finders::Favicon

Defined in:
lib/finders/favicon.rb

Constant Summary collapse

KEYWORDS =
['shortcut icon', 'icon shortcut', 'icon'].freeze

Class Method Summary collapse

Class Method Details

.call(elem) ⇒ Object



6
7
8
9
10
11
# File 'lib/finders/favicon.rb', line 6

def self.call(elem)
  return unless elem.tag == :link &&
                KEYWORDS.include?(elem.attributes[:rel])

  elem.attributes[:href]
end