Class: Sass::Tree::DebugNode
Overview
A dynamic node representing a Sass @debug statement.
Instance Method Summary
- - _perform(environment) protected Prints the expression to STDERR.
- - (DebugNode) initialize(expr) constructor A new instance of DebugNode.
- - to_src(tabs, opts, fmt) protected
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
8 9 10 11 |
# File '/var/www/haml-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.
24 25 26 27 28 29 30 31 32 33 |
# File '/var/www/haml-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)
16 17 18 |
# File '/var/www/haml-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
|