class Stylesheet::CssImportRule

Attributes

media[R]

Public Class Methods

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

Public Instance Methods

href() click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 10
def href
  @href
end
location() click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 24
def location
  @location ||= Location.new(@href,
    parent_style_sheet && parent_style_sheet.location)
end
style_sheet() click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 14
def style_sheet
  @style_sheet ||= CssStyleSheet.new(:href       => location.href,
                                     :owner_rule => self,
                                     :parent     => parent_style_sheet)
end
type() click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 6
def type
  CssRule::IMPORT_RULE
end

Private Instance Methods

href=(url) click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 31
def href=(url)
  @href = url.gsub(/url\(|\)|['";]+/, "")
end
media=(media) click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 35
def media=(media)
  @media = MediaList.new(media)
end
parse_css_text() click to toggle source
# File lib/stylesheet/css_import_rule.rb, line 39
def parse_css_text
  selector, self.href, self.media = css_text.gsub(";", "").split(" ", 3)
end