Module: Hashie::Extensions::Array::PrettyInspect

Included in:
Array
Defined in:
lib/hashie/extensions/array/pretty_inspect.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


5
6
7
8
# File 'lib/hashie/extensions/array/pretty_inspect.rb', line 5

def self.included(base)
  base.send :alias_method, :array_inspect, :inspect
  base.send :alias_method, :inspect, :hashie_inspect
end

Instance Method Details

#hashie_inspectObject


10
11
12
13
14
15
# File 'lib/hashie/extensions/array/pretty_inspect.rb', line 10

def hashie_inspect
  ret = "#<#{self.class} ["
  ret << to_a.map(&:inspect).join(', ')
  ret << ']>'
  ret
end