Class: Sass::Tree::TraceNode

Inherits:
Node
  • Object
show all
Defined in:
/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/trace_node.rb

Overview

A solely static node left over after a mixin include or @content has been performed. Its sole purpose is to wrap exceptions to add to the backtrace.

See Also:

Instance Attribute Summary (collapse)

Attributes inherited from Node

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

Class Method Summary (collapse)

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

- (TraceNode) initialize(name)

Returns a new instance of TraceNode

Parameters:

  • name (String)

    The name of the trace entry to add.



15
16
17
18
19
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/trace_node.rb', line 15

def initialize(name)
  @name = name
  self.has_children = true
  super()
end

Instance Attribute Details

- (String) name (readonly)

The name of the trace entry to add.

Returns:

  • (String)


12
13
14
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/trace_node.rb', line 12

def name
  @name
end

Class Method Details

+ (TraceNode) from_node(name, node)

Initializes this node from an existing node.

Parameters:

  • name (String)

    The name of the trace entry to add.

  • node (Node)

    The node to copy information from.

Returns:



25
26
27
28
29
30
31
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/trace_node.rb', line 25

def self.from_node(name, node)
  trace = new(name)
  trace.line = node.line
  trace.filename = node.filename
  trace.options = node.options
  trace
end