Ruby 1.8.7 Reference Manual > All Libraries > library yaml/rubytypes > class Integer > to_yaml
to_yaml(opts = {})
自身を YAML ドキュメントに変換します。
print 1.to_yaml # => --- 1 print -1.to_yaml # => --- -1