Class: Sass::Tree::ImportNode
- Inherits:
- RootNode show all
- Defined in:
- /Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/import_node.rb
Overview
A static node that wraps the Sass::Tree for an @import
ed file. It doesn’t have a functional purpose other than to add the @import
ed file to the backtrace if an error occurs.
Instance Attribute Summary (collapse)
- - (Sass::Engine) imported_file
Returns the imported file.
- - (String) imported_filename readonly
The name of the imported file as it appears in the Sass document.
Attributes inherited from RootNode
Attributes inherited from Node
#children, #filename, #has_children, #line, #options, #source_range
Instance Method Summary (collapse)
- - (Boolean) css_import?
Returns whether or not this import should emit a CSS @import declaration.
- - (ImportNode) initialize(imported_filename) constructor
A new instance of ImportNode.
- - (Boolean) invisible?
Methods inherited from RootNode
#render, #render_with_sourcemap
Methods inherited from Node
#<<, #==, #balance, #bubbles?, #css, #css_with_sourcemap, #deep_copy, #each, #inspect, #style, #to_sass, #to_scss
Constructor Details
- (ImportNode) initialize(imported_filename)
Returns a new instance of ImportNode
16 17 18 19 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/import_node.rb', line 16
def initialize(imported_filename)
@imported_filename = imported_filename
super(nil)
end |
Instance Attribute Details
- (Sass::Engine) imported_file
Returns the imported file.
27 28 29 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/import_node.rb', line 27
def imported_file
@imported_file ||= import
end |
- (String) imported_filename (readonly)
The name of the imported file as it appears in the Sass document.
10 11 12 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/import_node.rb', line 10
def imported_filename
@imported_filename
end |
Instance Method Details
- (Boolean) css_import?
Returns whether or not this import should emit a CSS @import declaration
34 35 36 37 38 39 40 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/import_node.rb', line 34
def css_import?
if @imported_filename =~ /\.css$/
@imported_filename
elsif imported_file.is_a?(String) && imported_file =~ /\.css$/
imported_file
end
end |
- (Boolean) invisible?
21 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/import_node.rb', line 21
def invisible?; to_s.empty?; end |