# Broken YAML.dump with YAML::Object (Missing String#each)

**URL:** <https://www.ruby-forum.com/t/broken-yaml-dump-with-yaml-object-missing-string-each/168352>\
**Category:** Ruby\
**Created:** [May 19, 2009, 9:53pm UTC](https://www.ruby-forum.com/t/broken-yaml-dump-with-yaml-object-missing-string-each/168352 "2009-05-19T21:53:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Gold](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@Jonathan\_Gold](https://www.ruby-forum.com/u/Jonathan_Gold)\
**Post date:** [May 19, 2009, 9:53pm UTC](https://www.ruby-forum.com/t/broken-yaml-dump-with-yaml-object-missing-string-each/168352/1 "2009-05-19T21:53:58Z")

</div>

I feel like I’ve discovered a bug in YAML.dump when used with  
yaml-tagged objects (YAML::Object). It seems that the YAML libs are  
still expecting to use String#each, but that’s gone. To repro:

```
ruby -ryaml -e 'anon_obj_yaml = "---

```

!ruby/object:No::Such::Class"; anon\_obj = YAML.load( anon\_obj\_yaml );  
YAML.dump( anon\_obj )’

Is this a bug?

jon
