Skip to content

Instantly share code, notes, and snippets.

@kouky
Created March 1, 2010 12:39
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 kouky/318332 to your computer and use it in GitHub Desktop.
Save kouky/318332 to your computer and use it in GitHub Desktop.
class Person < Struct.new(:name, :email, :gender)
def hash
pairs = []
each_pair {|key,val| pairs.push(key,val)}
Hash[*pairs]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment