Skip to content

Instantly share code, notes, and snippets.

@rjhornsby
Created September 30, 2015 14:25
Show Gist options
  • Save rjhornsby/7b820f7862955fbe3a80 to your computer and use it in GitHub Desktop.
Save rjhornsby/7b820f7862955fbe3a80 to your computer and use it in GitHub Desktop.
== constructing a dog ==
== constructing an animal ==
Pets rendered as JSON:
[{"json_class":"Dog","data":{"has_fur":true,"color":"black","name":"fido","bark":"loud"}}]
=== Recovering lost pets from the evil JSON Deville ===
Calling Dog::json_create
{"json_class"=>"Dog",
"data"=>{"has_fur"=>true, "color"=>"black", "name"=>"fido", "bark"=>"loud"}}
== constructing a dog ==
== constructing an animal ==
=== Here are your lost pets ===
[#<Dog:0x007fc7991e6140
@bark="loud",
@color="black",
@has_fur=true,
@name="fido">]
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment