Class: Snatch::Clean::CSS
- Inherits:
-
Object
- Object
- Snatch::Clean::CSS
- Defined in:
- lib/snatch/clean/css.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#working_directory ⇒ Object
Returns the value of attribute working_directory.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(doc, working_directory) ⇒ CSS
constructor
A new instance of CSS.
- #update ⇒ Object
Constructor Details
#initialize(doc, working_directory) ⇒ CSS
Returns a new instance of CSS.
6 7 8 9 |
# File 'lib/snatch/clean/css.rb', line 6 def initialize(doc, working_directory) self.doc = doc self.working_directory = working_directory end |
Instance Attribute Details
#doc ⇒ Object
Returns the value of attribute doc.
4 5 6 |
# File 'lib/snatch/clean/css.rb', line 4 def doc @doc end |
#working_directory ⇒ Object
Returns the value of attribute working_directory.
4 5 6 |
# File 'lib/snatch/clean/css.rb', line 4 def working_directory @working_directory end |
Class Method Details
.update(nokogiri_doc, working_directory = nil) ⇒ Object
11 12 13 |
# File 'lib/snatch/clean/css.rb', line 11 def self.update(nokogiri_doc, working_directory = nil) new(nokogiri_doc, working_directory).update end |
Instance Method Details
#update ⇒ Object
15 16 17 18 19 20 |
# File 'lib/snatch/clean/css.rb', line 15 def update doc.css('link[rel=stylesheet]').each do |stylesheet_node| stylesheet_node['href'] = rewrite_href(stylesheet_node['href']) end doc end |