Class: Sass::Tree::ImportNode
Overview
A static node that wraps the Sass::Tree for an @imported file. It doesn’t have a functional purpose other than to add the @imported file to the backtrace if an error occurs.
Instance Attribute Summary
- - (String) imported_filename readonly The name of the imported file as it appears in the Sass document.
Instance Method Summary
- - (Boolean) css_import? Returns whether or not this import should emit a CSS @import declaration.
- - (Sass::Engine) imported_file Returns the imported file.
- - (ImportNode) initialize(imported_filename) constructor A new instance of ImportNode.
- - (Boolean) invisible?
Methods inherited from RootNode
Methods inherited from Node
#<<, #==, #balance, #deep_copy, #do_extend, #each, #inspect, #style, #to_s, #to_sass, #to_scss
Constructor Details
- (ImportNode) initialize(imported_filename)
A new instance of ImportNode
13 14 15 16 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/import_node.rb', line 13
def initialize(imported_filename)
@imported_filename = imported_filename
super(nil)
end
|
Instance Attribute Details
- (String) imported_filename (readonly)
The name of the imported file as it appears in the Sass document.
10 11 12 |
# File '/var/www/sass-pages/.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
31 32 33 34 35 36 37 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/import_node.rb', line 31
def css_import?
if @imported_filename =~ /\.css$/
@imported_filename
elsif imported_file.is_a?(String) && imported_file =~ /\.css$/
imported_file
end
end
|
- (Sass::Engine) imported_file
Returns the imported file.
24 25 26 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/import_node.rb', line 24
def imported_file
@imported_file ||= import
end
|
- (Boolean) invisible?
18 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/import_node.rb', line 18
def invisible?; to_s.empty? end
|