possessive
Rails gem that lets you get a possessive form of a string. Supports localization in the style of ActiveSupport::Inflector.
Example
"Brian".possessive # => Brian's
"Sooners".possessive # => Sooners'
Install
# Gemfile
gem "more_possessive"
Localization
Sample configuration for German:
# config/initializers/inflections.rb
Possessive::Inflector.inflections(:de) do |inflect|
inflect.possessive /$/, 's'
inflect.possessive /(s|x|z)$/i, '\1’'
end
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (If you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull.)
- Send me a pull request. Bonus points for topic branches.
Copyright
Copyright (c) 2017 Brian Clubb, Robert Wünsch, Alizain Feerasta. See LICENSE for details.