Can Ruby's YAML module be used to embed comments?
问题 The to_yaml method produces nice YAML output, but I would like to include comment lines before some of the elements. Is there a way to do so? For example, I would like to produce: # hostname or IP address of client client: host4.example.com # hostname or IP address of server server: 192.168.222.222 From something similar to: { :client => 'host4.example.com', :server => '192.168.222.222', }.to_yaml ... but am not sure if the YAML module even has a way to accomplish. UPDATE: I ended up not