Class: Stylesheet::CssStyleRule

Inherits:
CssRule
  • Object
show all
Defined in:
lib/stylesheet/css_style_rule.rb

Constant Summary

Constants inherited from CssRule

Stylesheet::CssRule::CHARSET_RULE, Stylesheet::CssRule::FONT_FACE_RULE, Stylesheet::CssRule::IMPORT_RULE, Stylesheet::CssRule::MEDIA_RULE, Stylesheet::CssRule::NULL_RULE, Stylesheet::CssRule::STYLE_RULE

Instance Attribute Summary collapse

Attributes inherited from CssRule

#css_text, #parent_rule, #parent_style_sheet

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CssRule

factory, inherited, #initialize, #matches_rule?, #to_s

Constructor Details

This class inherits a constructor from Stylesheet::CssRule

Instance Attribute Details

#selector_textObject (readonly)

Returns the value of attribute selector_text.



4
5
6
# File 'lib/stylesheet/css_style_rule.rb', line 4

def selector_text
  @selector_text
end

Class Method Details

.matches_rule?(text) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/stylesheet/css_style_rule.rb', line 15

def self.matches_rule?(text)
  !text.include?("@")
end

Instance Method Details

#styleObject



10
11
12
13
# File 'lib/stylesheet/css_style_rule.rb', line 10

def style
  CssStyleDeclaration.new(:css_text    => @declarations, 
                          :parent_rule => self)
end

#typeObject



6
7
8
# File 'lib/stylesheet/css_style_rule.rb', line 6

def type
  CssRule::STYLE_RULE
end