Skip to content

Instantly share code, notes, and snippets.

@hooopo
Created November 27, 2009 00:56
Show Gist options
  • Save hooopo/243754 to your computer and use it in GitHub Desktop.
Save hooopo/243754 to your computer and use it in GitHub Desktop.
def age
years = Date.today.year - birth.year
years + (Date.today < birth + years.year ? -1 : 0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment