Created
September 25, 2015 19:10
-
-
Save rjhornsby/72fb3b6057d0d747246d 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
def to_h | |
super.merge( | |
{ | |
:asin => @asin | |
}) | |
end | |
def to_json(*a) | |
{ | |
:json_class => self.class.name, | |
:data => self.to_h | |
}.to_json(*a) | |
end | |
def self.json_create(*o) | |
new( | |
o[0]['data']['asin'], | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment