Skip to content

Instantly share code, notes, and snippets.

@pillowfactory
Created October 7, 2010 21:56
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 pillowfactory/615971 to your computer and use it in GitHub Desktop.
Save pillowfactory/615971 to your computer and use it in GitHub Desktop.
def possessify(word)
result = word.to_s.dup
if word.empty?
result
else
result.ends_with?('s') ? result << "'" : result << "'s"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment