[LRUG] Serialising a struct
sanelson at gmail.com
Mon Apr 14 07:07:09 PDT 2014
I'm working with some code that makes use of the new AWS SDK (
https://github.com/aws/aws-sdk-core-ruby) to retrieve data from (and make
calls into) AWS.
My responsibility (ie the stuff I want to test) is once I've got the data,
which I get from the aws-sdk-core library in the form of structs.
Obviously I don't want to keep calling AWS when testing, so I'm using a
What's the best way to make a struct available as canned data? I can view
the data I want as a struct using pry... or I can dump the API response
using VCR, but neither really helps. The API is actually just XML, and I
can't work out how to serialise the struct so I can get it back again as a
struct... Marshal doesn't support dumping from a Struct, JSON gives me a
string representation, and YAML gives me a Psych::Nodes::Document object...
Atalanta Systems Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chat