Class: Rack::Environmental
- Inherits:
-
Plastic
- Object
- Plastic
- Rack::Environmental
- Defined in:
- lib/rack-environmental.rb
Instance Method Summary collapse
Instance Method Details
#change_nokogiri_doc(doc) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rack-environmental.rb', line 6 def change_nokogiri_doc(doc) add_to_top_of_web_page(doc, create_sticker(doc)) if @environment_options[:background] body = doc.at_css("body") background_style = "background-color: #{@environment_options[:color] || default_color};" if body['style'] body['style'] << ";#{background_style}" else body['style'] = background_style end end doc end |