<div dir="ltr">Hi,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 14, 2014 at 3:27 PM, Paul Battley <span dir="ltr"><<a href="mailto:pbattley@gmail.com" target="_blank">pbattley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">On 14 April 2014 15:07, Stephen Nelson-Smith <<a href="mailto:sanelson@gmail.com">sanelson@gmail.com</a>> wrote:<br>

> Marshal doesn't support dumping from a Struct<br>
<br>
</div>Marshal doesn't support dumping an anonymous class. Structs are fine<br>
if they are assigned to a constant:<br>
<br>
    [1] pry(main)> Foo = Struct.new(:bar)<br>
    => Foo<br>
    [2] pry(main)> Marshal.dump(Foo.new)<br>
    => "\x04\bS:\bFoo\x06:\bbar0"<br>
<br>
I don't know if that helps you. If the structs are defined by the AWS<br>
library, perhaps not.<br></blockquote><div><br></div><div>Yep - thanks for the clarification.  What I get back from AWS is already an instance of the struct defined by AWS:<br><br> [56] pry(main)> i = ec2.describe_images(owners: ['self']).images.first.to_h; nil<br>
=> nil<br>[57] pry(main)> Marshal.dump(i)<br>TypeError: can't dump anonymous class #<Class:0x007ff5d9b6d768><br>from (pry):55:in `dump'<br></div><div><br>S.</div></div></div></div></div>