Class: Ruty::Tags::Debug

Inherits:
Ruty::Tag show all
Defined in:
lib/ruty/tags/debug.rb

Instance Method Summary collapse

Constructor Details

#initialize(parser, argstring) ⇒ Debug

Returns a new instance of Debug.



14
15
16
# File 'lib/ruty/tags/debug.rb', line 14

def initialize parser, argstring
  parser.fail('debug tag takes no arguments') if not argstring.empty?
end

Instance Method Details

#render_node(context, stream) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/ruty/tags/debug.rb', line 18

def render_node context, stream
  buffer = StringIO.new
  PP.pp(context, buffer)
  buffer.rewind
  stream << buffer.read.strip
  buffer.close
end