Class: Sass::Tree::DebugNode

Inherits:
Node show all
Defined in:
lib/sass/tree/debug_node.rb

Overview

A dynamic node representing a Sass @debug statement.

See Also:

Instance Attribute Summary

Attributes inherited from Node

#children, #filename, #line, #options

Instance Method Summary collapse

Methods inherited from Node

#<<, #==, #_to_s, #balance, #interpolate, #invalid_child?, #invisible?, #last, #perform, #perform!, #perform_children, #render, #style, #to_s, #to_sass

Constructor Details

#initialize(expr) ⇒ DebugNode

Returns a new instance of DebugNode.

Parameters:



8
9
10
11
# File 'lib/sass/tree/debug_node.rb', line 8

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

Instance Method Details

#_perform(environment) ⇒ Object (protected)

Prints the expression to STDERR.

Parameters:

  • environment (Sass::Environment)

    The lexical environment containing variable and mixin values



19
20
21
22
23
24
25
26
27
# File 'lib/sass/tree/debug_node.rb', line 19

def _perform(environment)
  res = @expr.perform(environment)
  if filename
    STDERR.puts "#{filename}:#{line} DEBUG: #{res}"
  else
    STDERR.puts "Line #{line} DEBUG: #{res}"
  end
  []
end