When I\'m running a simple Ruby script, what\'s the easiest way to dump an object\'s fields to the console?
I\'m looking for something similar to PHP\'s print
print
The to_yaml method seems to be useful sometimes:
to_yaml
$foo = {:name => "Clem", :age => 43} puts $foo.to_yaml
returns
--- :age: 43 :name: Clem
(Does this depend on some YAML module being loaded? Or would that typically be available?)
YAML