Class: PrettyArray

Inherits:
Array show all
Defined in:
lib/pretty_debug.rb

Overview

Inspection

Constant Summary

Constants inherited from Array

Array::SingleLength

Instance Method Summary collapse

Methods inherited from Array

#align, #common_affix, #common_prefix, #original_inspect

Constructor Details

#initialize(a) ⇒ PrettyArray

Returns a new instance of PrettyArray.



194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/pretty_debug.rb', line 194

def initialize a
	super(a)
	reject!{
		|f, l, m|
		f == __FILE__ or
		m =~ /\A<.*>\z/ # Such as `<top (required)>`, `<module:Foo>`.
	}
	reject, select =
	[:@reject, :@select].map{|sym| PrettyDebug.instance_variable_get(sym)}
	reject!{|f, l, m| reject.call(f, m)} rescue nil
	select!{|f, l, m| select.call(f, m)} rescue nil
end

Instance Method Details

#inspectObject



207
# File 'lib/pretty_debug.rb', line 207

def inspect; to_puts.join($/) end

#to_putsObject



206
# File 'lib/pretty_debug.rb', line 206

def to_puts; align.map(&PrettyDebug.instance_variable_get(:@format)) end