fast_open_struct icon indicating copy to clipboard operation
fast_open_struct copied to clipboard

Structs should be serializable

Open gusevfe opened this issue 11 years ago • 0 comments

It would be very useful to be able to serialize fast open structs, since usual open structs allow this. For example, Marshal can be used with regular structs, but not with open ones.

$ irb
irb(main):001:0> require 'ostruct'
=> true
irb(main):002:0> Marshal.dump(OpenStruct.new)
=> "\x04\bU:\x0FOpenStruct{\x00"
irb(main):003:0> require 'fast_open_struct'
=> true
irb(main):004:0> Marshal.dump(FastOpenStruct.new)
TypeError: can't dump anonymous class #<Class:0x20055030>
        from (irb):4:in `dump'
        from (irb):4
        from /usr/bin/irb:12:in `<main>'

gusevfe avatar Feb 16 '14 20:02 gusevfe