Class: Sass::Tree::TraceNode

Inherits:
Node
  • Object
show all
Defined in:
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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(name) ⇒ TraceNode

Returns a new instance of TraceNode.

Parameters:

  • name (String)

    The name of the trace entry to add.



14
15
16
17
18
# File 'lib/sass/tree/trace_node.rb', line 14

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

Instance Attribute Details

#nameString (readonly)

The name of the trace entry to add.

Returns:

  • (String)


11
12
13
# File 'lib/sass/tree/trace_node.rb', line 11

def name
  @name
end

Class Method Details

.from_node(name, node) ⇒ TraceNode

Initializes this node from an existing node.

Parameters:

  • name (String)

    The name of the trace entry to add.

  • mixin (Node)

    The node to copy information from.

Returns:



24
25
26
27
28
29
30
# File 'lib/sass/tree/trace_node.rb', line 24

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