Bugs item #9518, was opened at 2007-03-24 14:47
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=9518&group_id=426

Category: Standard Library
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Bertram Scharpf (bscharpf)
Assigned to: Nobody (None)
Summary: YAML: Derived String and binary data.

Initial Comment:
The class of a derived String gets lost when the data is binary:

  irb(main):001:0> require "yaml"
  => true
  irb(main):002:0> class D < String ; end
  => nil
  irb(main):003:0> h = D.new "hi, there"
  => "hi, there"
  irb(main):004:0> b = D.new "\x00\x01\x02"
  => "\000\001\002"
  irb(main):005:0> (YAML.load h.to_yaml).class
  => D
  irb(main):006:0> (YAML.load b.to_yaml).class
  => String


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=9518&group_id=426