Class: Sass::Tree::DebugNode

Inherits:
Node show all
Defined in:
/var/www/sass-pages/.haml/lib/sass/tree/debug_node.rb

Overview

A dynamic node representing a Sass @debug statement.

See Also:

Instance Method Summary

Methods inherited from Node

#<<, #==, #_cssize, #_to_s, #balance, #check_child!, #children_to_src, #cssize, #cssize!, #dasherize, #do_extend, #each, #invalid_child?, #invisible?, #perform, #perform!, #perform_children, #run_interp, #selector_to_sass, #selector_to_scss, #selector_to_src, #semi, #style, #to_s, #to_sass, #to_scss

Constructor Details

- (DebugNode) initialize(expr)

A new instance of DebugNode

Parameters:



8
9
10
11
# File '/var/www/sass-pages/.haml/lib/sass/tree/debug_node.rb', line 8

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

Instance Method Details

- _perform(environment) (protected)

Prints the expression to STDERR.

Parameters:

  • (Sass::Environment) environment — The lexical environment containing variable and mixin values


24
25
26
27
28
29
30
31
32
33
# File '/var/www/sass-pages/.haml/lib/sass/tree/debug_node.rb', line 24

def _perform(environment)
  res = @expr.perform(environment)
  res = res.value if res.is_a?(Sass::Script::String)
  if filename
    $stderr.puts "#{filename}:#{line} DEBUG: #{res}"
  else
    $stderr.puts "Line #{line} DEBUG: #{res}"
  end
  []
end

- to_src(tabs, opts, fmt) (protected)

See Also:



16
17
18
# File '/var/www/sass-pages/.haml/lib/sass/tree/debug_node.rb', line 16

def to_src(tabs, opts, fmt)
  "#{'  ' * tabs}@debug #{@expr.to_sass(opts)}#{semi fmt}\n"
end