Created
September 29, 2015 17:09
-
-
Save rjhornsby/3966ac3ee383ed6553c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./shelter.rb | |
== 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:0x007fae530fe430 @bark="loud", @color=nil, @has_fur="loud", @name=nil>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment