Module: Ducktrap::PrettyDump

Included in:
Error, Evaluator, Node
Defined in:
lib/ducktrap/pretty_dump.rb

Overview

Mixin for pretty dumpable objects

Instance Method Summary collapse

Instance Method Details

#pretty_dump(output = Formatter.new) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Perform pretty dump of ducktrap

Returns:

  • (self)


11
12
13
14
# File 'lib/ducktrap/pretty_dump.rb', line 11

def pretty_dump(output=Formatter.new)
  dump(output)
  self
end

#pretty_inspectString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return pretty inspection

Returns:

  • (String)


22
23
24
25
26
27
28
# File 'lib/ducktrap/pretty_dump.rb', line 22

def pretty_inspect
  io = StringIO.new
  formatter = Formatter.new(io)
  pretty_dump(formatter)
  io.rewind
  io.read
end