Class | Sass::Tree::DebugNode
In: | lib/sass/tree/debug_node.rb
Parent: | Node

A dynamic node representing a Sass `@debug` statement.

@see Sass::Tree

### Methods

_perform new to_src

### Public Class methods

new(expr)

@param expr [Script::Node] The expression to print

[Source]

        # File lib/sass/tree/debug_node.rb, line 8
     8:       def initialize(expr)
     9:         @expr = expr
    10:         super()
    11:       end

### Protected Instance methods

_perform(environment)

Prints the expression to STDERR.

@param environment [Sass::Environment] The lexical environment containing

      variable and mixin values

[Source]

        # File lib/sass/tree/debug_node.rb, line 24
    24:       def _perform(environment)
    25:         res = @expr.perform(environment)
    26:         res = res.value if res.is_a?(Sass::Script::String)
    27:         if filename
    28:           $stderr.puts "#{filename}:#{line} DEBUG: #{res}"
    29:         else
    30:           $stderr.puts "Line #{line} DEBUG: #{res}"
    31:         end
    32:         []
    33:       end

to_src(tabs, opts, fmt)

@see Node#to_src

[Source]

        # File lib/sass/tree/debug_node.rb, line 16
    16:       def to_src(tabs, opts, fmt)
    17:         "#{'  ' * tabs}@debug #{@expr.to_sass(opts)}#{semi fmt}\n"
    18:       end

[Validate]