Class: Sass::Tree::RootNode

Inherits:
Node
  • Object
show all
Defined in:
/home/nweiz/code/sass-site/.sass/lib/sass/tree/root_node.rb

Overview

A static node that is the root node of the Sass document.

Direct Known Subclasses

ImportNode

Instance Attribute Summary (collapse)

Attributes inherited from Node

#children, #filename, #has_children, #line, #options, #source_range

Instance Method Summary (collapse)

Methods inherited from Node

#<<, #==, #balance, #bubbles?, #css, #css_with_sourcemap, #deep_copy, #each, #inspect, #invisible?, #style, #to_sass, #to_scss

Constructor Details

- (RootNode) initialize(template)

Returns a new instance of RootNode

Parameters:

  • template (String)

    The Sass template from which this node was created



11
12
13
14
# File '/home/nweiz/code/sass-site/.sass/lib/sass/tree/root_node.rb', line 11

def initialize(template)
  super()
  @template = template
end

Instance Attribute Details

- template (readonly)

The Sass template from which this node was created

Parameters:

  • template (String)


8
9
10
# File '/home/nweiz/code/sass-site/.sass/lib/sass/tree/root_node.rb', line 8

def template
  @template
end

Instance Method Details

- (String) render

Runs the dynamic Sass code and computes the CSS for the tree.

Returns:

  • (String)

    The compiled CSS.



19
20
21
# File '/home/nweiz/code/sass-site/.sass/lib/sass/tree/root_node.rb', line 19

def render
  css_tree.css
end

- ((String, Sass::Source::Map)) render_with_sourcemap

Runs the dynamic Sass code and computes the CSS for the tree, along with the sourcemap.

Returns:

  • ((String, Sass::Source::Map))

    The compiled CSS, as well as the source map. @see #render



28
29
30
# File '/home/nweiz/code/sass-site/.sass/lib/sass/tree/root_node.rb', line 28

def render_with_sourcemap
  css_tree.css_with_sourcemap
end