Skip to content

Instantly share code, notes, and snippets.

@bryfox
Created March 26, 2010 18:23
Show Gist options
  • Save bryfox/345209 to your computer and use it in GitHub Desktop.
Save bryfox/345209 to your computer and use it in GitHub Desktop.
module DataMapper
module Resource
def to_hash
h = {}
self.class.properties.collect {|p| p.name}.each do | property |
h[property.to_sym] = self[property]
end
h
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment