Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
PP::PPMethods#pp_object
(untyped obj) -> untyped
pp_object(obj)
lib/pp.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/pp.rb, line 275
def pp_object(obj)
object_address_group(obj) {
seplist(obj.pretty_print_instance_variables, lambda { text ',' }) {|v|
breakable
v = v.to_s if Symbol === v
text v
text '='
group(1) {
breakable ''
pp(obj.instance_eval(v))
}
}
}
end
A present standard failsafe for pretty printing any given Object
See also
#pp_hash_pair
#push_inspect_key
#pp_hash
#seplist
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0