Skip to content

Instantly share code, notes, and snippets.

@tagrudev
Created June 18, 2013 09:41
Show Gist options
  • Save tagrudev/5804054 to your computer and use it in GitHub Desktop.
Save tagrudev/5804054 to your computer and use it in GitHub Desktop.
module Bdz
module Serializable
def as_hash
hash = {}
self.instance_variables.each do |var|
hash[var.to_s.gsub("@", "")] = self.instance_variable_get var
end
hash
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment