Class: CSSPool::CSS::ImportRule

Inherits:
Struct
  • Object
show all
Includes:
Visitable
Defined in:
lib/csspool/css/import_rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Visitable

#==, #accept, #children, #each, #hash, #to_css

Instance Attribute Details

#documentObject

Returns the value of attribute document

Returns:

  • (Object)

    the current value of document



3
4
5
# File 'lib/csspool/css/import_rule.rb', line 3

def document
  @document
end

#mediaObject

Returns the value of attribute media

Returns:

  • (Object)

    the current value of media



3
4
5
# File 'lib/csspool/css/import_rule.rb', line 3

def media
  @media
end

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



3
4
5
# File 'lib/csspool/css/import_rule.rb', line 3

def namespace
  @namespace
end

#parse_locationObject

Returns the value of attribute parse_location

Returns:

  • (Object)

    the current value of parse_location



3
4
5
# File 'lib/csspool/css/import_rule.rb', line 3

def parse_location
  @parse_location
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



3
4
5
# File 'lib/csspool/css/import_rule.rb', line 3

def uri
  @uri
end

Instance Method Details

#loadObject



6
7
8
9
10
11
12
# File 'lib/csspool/css/import_rule.rb', line 6

def load
  new_doc = CSSPool.CSS yield(uri)
  new_doc.parent_import_rule = self
  new_doc.parent = document
  new_doc.rule_sets.each { |rs| rs.media = media }
  new_doc
end