Class: InlineStyle::CSSPoolWrapper
- Inherits:
-
Object
- Object
- InlineStyle::CSSPoolWrapper
- Defined in:
- lib/inline-style/csspool_wrapper.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize(css_code) ⇒ CSSPoolWrapper
constructor
A new instance of CSSPoolWrapper.
Constructor Details
#initialize(css_code) ⇒ CSSPoolWrapper
Returns a new instance of CSSPoolWrapper.
5 6 7 8 9 10 |
# File 'lib/inline-style/csspool_wrapper.rb', line 5 def initialize css_code parser = CSSPool.CSS css_code @rules = parser.rule_sets.map do |rule_set| rule_set.selectors.map { |sel| Rule.new(sel.to_s, sel.declarations.join, "0#{sel.specificity.join}") } end.flatten end |
Instance Attribute Details
#rules ⇒ Object
Returns the value of attribute rules.
3 4 5 |
# File 'lib/inline-style/csspool_wrapper.rb', line 3 def rules @rules end |