Module: Array::PrettyInspect

Included in:
Array
Defined in:
lib/pretty_debug.rb

Constant Summary collapse

SingleLength =
50

Instance Method Summary collapse

Instance Method Details

#inspectObject



243
244
245
246
247
248
# File 'lib/pretty_debug.rb', line 243

def inspect
	return super if recursive?
	s = map(&:inspect)
	length < 2 || s.map(&:length).inject(:+) < SingleLength ?
		"[#{s.join(", ".freeze)}]" : "[#$/#{s.join(",#$/".freeze).indent}#$/]"
end