Skip to content

Instantly share code, notes, and snippets.

@keolo
Created September 23, 2010 05:26
Show Gist options
  • Save keolo/593169 to your computer and use it in GitHub Desktop.
Save keolo/593169 to your computer and use it in GitHub Desktop.
# There's got to be a better way to do this!!
class Object
def instance_values
self.instance_variables.map{|var| var_sym = var.to_s.gsub('@','').to_sym; {var_sym => self.send(var_sym)}}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment