Skip to content

Instantly share code, notes, and snippets.

@Heavyblade
Created May 30, 2012 20:42
Show Gist options
  • Save Heavyblade/2838827 to your computer and use it in GitHub Desktop.
Save Heavyblade/2838827 to your computer and use it in GitHub Desktop.
def to_json
attributes = [
:name,
     :description,
     :website,
     :organization,
     :support_url]
json = {}
attributes.each { |attr| json[attr] = self.send(attr.to_s)}
json.to_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment