Skip to content

Instantly share code, notes, and snippets.

@rjhornsby
Created September 25, 2015 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjhornsby/72fb3b6057d0d747246d to your computer and use it in GitHub Desktop.
Save rjhornsby/72fb3b6057d0d747246d to your computer and use it in GitHub Desktop.
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