Class: Gatchaman::Embedder::CSS

Inherits:
Generic
  • Object
show all
Defined in:
lib/gatchaman/embedder/css.rb

Instance Method Summary collapse

Methods inherited from Generic

#expand, #initialize

Constructor Details

This class inherits a constructor from Gatchaman::Embedder::Generic

Instance Method Details

#embed(doc) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/gatchaman/embedder/css.rb', line 4

def embed(doc)
  doc.css('link[rel=stylesheet]').each do |element|
    embed_element(element)
  end
  doc.css('style').each do |element|
    element.content = embed_all_url_in_css(element.content)
  end
  doc
end