Class: CSSFilter::Tree
- Inherits:
-
Hash
- Object
- Hash
- CSSFilter::Tree
- Defined in:
- lib/cssfilter.rb
Overview
CSS parse tree. This is for a “deep filtering”.
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ Tree
constructor
A new instance of Tree.
-
#to_css ⇒ Object
Re-output the CSS, all tidy ;).
Constructor Details
#initialize(options = nil) ⇒ Tree
Returns a new instance of Tree.
199 200 201 202 |
# File 'lib/cssfilter.rb', line 199 def initialize(=nil) = || {} super() end |
Instance Method Details
#to_css ⇒ Object
Re-output the CSS, all tidy ;)
206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/cssfilter.rb', line 206 def to_css css = "" each do |selector, entries| css << "#{selector}{" entries.each do |key, value| css << "#{key}:#{value};" end css << "}\n" end return css end |