Class: Hash

Inherits:
Object show all
Defined in:
lib/colorful_inspect.rb

Instance Method Summary collapse

Instance Method Details

#colorless_pretty_printObject



117
# File 'lib/colorful_inspect.rb', line 117

alias colorless_pretty_print pretty_print

#pretty_print(q) ⇒ Object



119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/colorful_inspect.rb', line 119

def pretty_print(q)
  return q.text("{}") if empty?

  ColorfulInspect.group(q, "{", "}") do
    each_with_index do |(key, val), n|
      ColorfulInspect.break q
      q.pp key
      q.text " => "
      q.pp val
      q.text "," if n != size - 1
    end
  end
end