Class: Sass::Tree::DebugNode
Overview
A dynamic node representing a Sass @debug
statement.
Constant Summary
Constants inherited from Node
Instance Attribute Summary
Attributes inherited from Node
#children, #filename, #has_children, #line, #options
Instance Method Summary collapse
-
#_perform(environment)
protected
Prints the expression to STDERR.
-
#initialize(expr) ⇒ DebugNode
constructor
A new instance of DebugNode.
- #to_src(tabs, opts, fmt) protected
Methods inherited from Node
#<<, #==, #_around_dump, #_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
#initialize(expr) ⇒ DebugNode
Returns a new instance of DebugNode.
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) (protected)
Prints the expression to STDERR.
24 25 26 27 28 29 30 31 32 33 |
# File '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)
16 17 18 |
# File 'lib/sass/tree/debug_node.rb', line 16
def to_src(tabs, opts, fmt)
"#{' ' * tabs}@debug #{@expr.to_sass(opts)}#{semi fmt}\n"
end
|