class Stylesheet::CssStyleRule

Attributes

selector_text[R]

Public Class Methods

matches_rule?(text) click to toggle source
# File lib/stylesheet/css_style_rule.rb, line 15
def self.matches_rule?(text)
  !text.include?("@")
end

Public Instance Methods

style() click to toggle source
# File lib/stylesheet/css_style_rule.rb, line 10
def style
  CssStyleDeclaration.new(:css_text    => @declarations, 
                          :parent_rule => self)
end
type() click to toggle source
# File lib/stylesheet/css_style_rule.rb, line 6
def type
  CssRule::STYLE_RULE
end

Private Instance Methods

parse_css_text() click to toggle source
# File lib/stylesheet/css_style_rule.rb, line 21
def parse_css_text
  return unless css_text.include?("{")

  selector, declarations = css_text.split("{")
  @selector_text = selector.strip
  @declarations  = declarations.gsub(/\}\s*$/, "")
end