Class: CSSPool::CSS::ImportRule

Inherits:
Node
  • Object
show all
Defined in:
lib/csspool/css/import_rule.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#inner_end_pos, #inner_start_pos, #outer_end_pos, #outer_start_pos

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(uri, namespace, media_list, document, parse_location) ⇒ ImportRule

Returns a new instance of ImportRule.



10
11
12
13
14
15
16
# File 'lib/csspool/css/import_rule.rb', line 10

def initialize uri, namespace, media_list, document, parse_location
  @uri = uri
  @namespace = namespace
  @media_list = media_list
  @document = document
  @parse_location = parse_location
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



7
8
9
# File 'lib/csspool/css/import_rule.rb', line 7

def document
  @document
end

#media_listObject

Returns the value of attribute media_list.



6
7
8
# File 'lib/csspool/css/import_rule.rb', line 6

def media_list
  @media_list
end

#namespaceObject

Returns the value of attribute namespace.



5
6
7
# File 'lib/csspool/css/import_rule.rb', line 5

def namespace
  @namespace
end

#parse_locationObject

Returns the value of attribute parse_location.



8
9
10
# File 'lib/csspool/css/import_rule.rb', line 8

def parse_location
  @parse_location
end

#uriObject

Returns the value of attribute uri.



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

def uri
  @uri
end

Instance Method Details

#loadObject



18
19
20
21
22
23
# File 'lib/csspool/css/import_rule.rb', line 18

def load
  new_doc = CSSPool.CSS(yield uri.value)
  new_doc.parent_import_rule = self
  new_doc.parent = document
  new_doc
end