Skip to content

Instantly share code, notes, and snippets.

@barce
Created February 17, 2010 20:18
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 barce/306979 to your computer and use it in GitHub Desktop.
Save barce/306979 to your computer and use it in GitHub Desktop.
class Chamber
attr_accessor :name, :address, :state, :city, :zip
def to_json(*a)
{
'json_class' => self.class.name, # = 'Chamber'
'data' => [ name, address, state, city, zip ]
}.to_json(*a)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment