Class: Sass::Tree::ImportNode
- Defined in:
- 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
-
#imported_filename ⇒ String
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
Instance Method Summary collapse
-
#css_import? ⇒ Boolean
Returns whether or not this import should emit a CSS @import declaration.
-
#imported_file ⇒ Sass::Engine
Returns the imported file.
-
#initialize(imported_filename) ⇒ ImportNode
constructor
A new instance of ImportNode.
- #invisible? ⇒ Boolean
Methods inherited from RootNode
Methods inherited from Node
#<<, #==, #balance, #deep_copy, #do_extend, #each, #style, #to_s, #to_sass, #to_scss
Constructor Details
#initialize(imported_filename) ⇒ ImportNode
Returns a new instance of ImportNode.
13 14 15 16 |
# File 'lib/sass/tree/import_node.rb', line 13
def initialize(imported_filename)
@imported_filename = imported_filename
super(nil)
end
|
Instance Attribute Details
#imported_filename ⇒ String (readonly)
The name of the imported file as it appears in the Sass document.
10 11 12 |
# File 'lib/sass/tree/import_node.rb', line 10
def imported_filename
@imported_filename
end
|
Instance Method Details
#css_import? ⇒ Boolean
Returns whether or not this import should emit a CSS @import declaration
31 32 33 34 35 36 37 |
# File '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
|
#imported_file ⇒ Sass::Engine
Returns the imported file.
24 25 26 |
# File 'lib/sass/tree/import_node.rb', line 24
def imported_file
@imported_file ||= import
end
|
#invisible? ⇒ Boolean
18 |
# File 'lib/sass/tree/import_node.rb', line 18
def invisible?; to_s.empty?; end
|