Class: PrettyArray
Overview
Inspection
Constant Summary
Constants inherited from Array
Instance Method Summary collapse
-
#initialize(a) ⇒ PrettyArray
constructor
A new instance of PrettyArray.
- #inspect ⇒ Object
- #to_puts ⇒ Object
Methods inherited from Array
#align, #common_affix, #common_prefix, #original_inspect
Constructor Details
#initialize(a) ⇒ PrettyArray
Returns a new instance of PrettyArray.
192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/pretty_debug.rb', line 192 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
#inspect ⇒ Object
204 |
# File 'lib/pretty_debug.rb', line 204 def inspect; to_puts.join($/) end |
#to_puts ⇒ Object
203 |
# File 'lib/pretty_debug.rb', line 203 def to_puts; align.map(&PrettyDebug.instance_variable_get(:@format)) end |