Method: Object#pp_s

Defined in:
lib/jinx/helpers/pretty_print.rb

#pp_s(opts = nil) ⇒ String

Formats this object with the standard PrettyPrint.

Parameters:

  • opts (Hash, Symbol, nil) (defaults to: nil)

    the print options

Options Hash (opts):

  • :single_line (Boolean)

    print the output on a single line

Returns:

  • (String)

    the formatted print result



62
63
64
65
66
67
68
69
70
71
# File 'lib/jinx/helpers/pretty_print.rb', line 62

def pp_s(opts=nil)
  s = StringIO.new
  if Options.get(:single_line, opts) then
    PP.singleline_pp(self, s)
  else
    PP.pp(self, s)
  end
  s.rewind
  s.read.chomp
end