Class: CSSPool::CSS::ImportRule
- Defined in:
- lib/csspool/css/import_rule.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#media ⇒ Object
Returns the value of attribute media.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#parse_location ⇒ Object
Returns the value of attribute parse_location.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, namespace, media, document, parse_location) ⇒ ImportRule
constructor
A new instance of ImportRule.
- #load ⇒ Object
Methods inherited from Node
#==, #accept, #children, #each, #hash, #to_css, #to_minified_css
Constructor Details
#initialize(uri, namespace, media, 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, document, parse_location @uri = uri @namespace = namespace @media = media @document = document @parse_location = parse_location end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
7 8 9 |
# File 'lib/csspool/css/import_rule.rb', line 7 def document @document end |
#media ⇒ Object
Returns the value of attribute media.
6 7 8 |
# File 'lib/csspool/css/import_rule.rb', line 6 def media @media end |
#namespace ⇒ Object
Returns the value of attribute namespace.
5 6 7 |
# File 'lib/csspool/css/import_rule.rb', line 5 def namespace @namespace end |
#parse_location ⇒ Object
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 |
#uri ⇒ Object
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
#load ⇒ Object
18 19 20 21 22 23 24 |
# 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.rule_sets.each { |rs| rs.media = media } new_doc end |