Class: InlineStyle::CssParserWrapper
- Inherits:
-
Object
- Object
- InlineStyle::CssParserWrapper
- Defined in:
- lib/inline-style/css_parser_wrapper.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize(css_code) ⇒ CssParserWrapper
constructor
A new instance of CssParserWrapper.
Constructor Details
#initialize(css_code) ⇒ CssParserWrapper
Returns a new instance of CssParserWrapper.
7 8 9 10 11 12 13 |
# File 'lib/inline-style/css_parser_wrapper.rb', line 7 def initialize(css_code) parser, @rules = CssParser::Parser.new, [] parser.add_block! css_code parser.each_rule_set do |rule_set| rule_set.each_selector { |sel, dec, spec| @rules << Rule.new(sel, dec, '%04d' % spec.to_i) } end end |
Instance Attribute Details
#rules ⇒ Object
Returns the value of attribute rules.
5 6 7 |
# File 'lib/inline-style/css_parser_wrapper.rb', line 5 def rules @rules end |