{"id":19725312,"url":"https://github.com/bodacious/genderize","last_synced_at":"2025-04-29T23:30:39.325Z","repository":{"id":8329996,"uuid":"9883416","full_name":"Bodacious/genderize","owner":"Bodacious","description":"A helpful class for gender-specific models in Ruby applications.   Genderize adds useful helper methods for various pronouns and other written forms of male and female genders.","archived":false,"fork":false,"pushed_at":"2018-01-24T20:32:44.000Z","size":87,"stargazers_count":9,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T18:13:49.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bodacious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-06T09:14:04.000Z","updated_at":"2021-09-22T10:45:27.000Z","dependencies_parsed_at":"2022-08-07T02:31:06.056Z","dependency_job_id":null,"html_url":"https://github.com/Bodacious/genderize","commit_stats":null,"previous_names":["katanacode/genderize"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2Fgenderize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2Fgenderize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2Fgenderize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2Fgenderize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bodacious","download_url":"https://codeload.github.com/Bodacious/genderize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251599699,"owners_count":21615570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T23:29:21.851Z","updated_at":"2025-04-29T23:30:36.709Z","avatar_url":"https://github.com/Bodacious.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Genderize\n\nGenderize is a simple Rails gem for adding gender helper methods to Rails models.\n\n_New:_\n- (0.1.1) options to coerce invalid input to nil or to coerce empty string to nil\n- (0.1.0) we now have non-binary as an option\n\n## Example\n\n\n### Feminine\n\n    # Setting the gender is simple - just set the attribute value to \"m\", \"n\", or \"f\"\n    @user = User.new(gender: \"f\")\n\n    # This also works\n    @user = User.new(gender: \"female\")\n\n    # This gives us a few helper methods to add gender specific text to our views\n    @user.gender.male? # =\u003e false\n    @user.gender.non_binary? # =\u003e false\n    @user.gender.name # =\u003e \"female\"\n    @user.gender.to_s # =\u003e \"f\"\n    @user.gender.abbr # =\u003e \"f\"\n\n    # gender pronouns\n    # As the subject of a sentence\n    @user.gender.subject # =\u003e 'she'\n\n    # As the object of a sentence\n    @user.gender.object # =\u003e 'her'\n\n    # Showing possession\n    @user.gender.possessive # =\u003e 'her'\n\n    # Writing a casual form of the gender\n    @user.gender.casual # =\u003e \"girl\"\n\n### Masculine\n\n    # Setting the gender is simple - just set the attribute value to \"m\", \"n\", or \"f\"\n    @user = User.new(gender: \"m\")\n\n    # This also works\n    @user = User.new(gender: \"male\")\n\n    # This gives us a few helper methods to add gender specific text to our views\n    @user.gender.female? # =\u003e false\n    @user.gender.non_binary? # =\u003e false\n    @user.gender.name # =\u003e \"male\"\n    @user.gender.to_s # =\u003e \"m\"\n    @user.gender.abbr # =\u003e \"m\"\n\n    # gender pronouns\n    # As the subject of a sentence\n    @user.gender.subject # =\u003e 'he'\n\n    # As the object of a sentence\n    @user.gender.object # =\u003e 'him'\n\n    # Showing possession\n    @user.gender.possessive # =\u003e 'his'\n\n    # Writing a casual form of the gender\n    @user.gender.casual # =\u003e \"guy\"\n\n### Non-binary\n\n    # Setting the gender is simple - just set the attribute value to \"m\", \"n\", or \"f\"\n    @user = User.new(gender: \"n\")\n\n    # This also works\n    @user = User.new(gender: \"non-binary\")\n    @user = User.new(gender: \"non_binary\")\n    @user = User.new(gender: \"non binary\")\n\n    # This gives us a few helper methods to add gender specific text to our views\n    @user.gender.female? # =\u003e false\n    @user.gender.male? # =\u003e false\n    @user.gender.non_binary? # =\u003e true\n    @user.gender.name # =\u003e \"non_binary\"\n    @user.gender.to_s # =\u003e \"n\"\n    @user.gender.abbr # =\u003e \"n\"\n\n    # gender pronouns\n    # As the subject of a sentence\n    @user.gender.subject # =\u003e 'they'\n\n    # As the object of a sentence\n    @user.gender.object # =\u003e 'them'\n\n    # Showing possession\n    @user.gender.possessive # =\u003e 'their'\n\n    # Writing a casual form of the gender\n    @user.gender.casual # =\u003e \"person\"\n\n### Blank (no gender specified)\n\n    @user = User.new(gender: \"\")\n\n    # This gives us a few helper methods to add gender specific text to our views\n    @user.gender.female? # =\u003e false\n    @user.gender.male? # =\u003e false\n    @user.gender.name # =\u003e \"\"\n    @user.gender.to_s # =\u003e \"\"\n    @user.gender.abbr # =\u003e \"\"\n\n    # gender pronouns\n    # As the subject of a sentence\n    @user.gender.subject # =\u003e 'they'\n\n    # As the object of a sentence\n    @user.gender.object # =\u003e 'them'\n\n    # Showing possession\n    @user.gender.possessive # =\u003e 'their'\n\n    # Writing a casual form of the gender\n    @user.gender.casual # =\u003e \"person\"\n\n## Changing these values\n\nYou can change the values for each of the methods described above by modifying your locales file. See [config/locales/en.yml](config/locales/genderize.en.yml) for more info.\n\n## Installation\n\nAdd this to your Gemfile:\n\n\n    gem \"genderize\"\n\n...and run `bundle install` to install the gem.\n\nNext, run:\n\n    $ rails g genderize:install\n\n... to install the genderize.en.yml file in your locales directory\n\nFinally, to *genderize* a model attribute:\n\n\n    class User \u003c ActiveRecord::Base\n\n      genderize\n\n      # ... or, if your db column isn't named `gender`\n      genderize(:user_gender)\n\n      ### New opts (must specify column name to use)\n      # ... to prevent storing empty strings and store them as nil instead\n      genderize(:gender, no_empty_string: true)\n\n      # ... to coerce invalid arguments to nil rather than throwing ArgumentError\n      genderize(:gender, set_invalid_to_nil: true)\n\n      # ... these can be combined together\n      genderize(:gender, set_invalid_to_nil: true, no_empty_string: true)\n\n    end      \n\n\n## Issues\n\nIf you discover a problem with Genderize, please let us know about it.\n\n**Remember** to search the [issues list](https://github.com/KatanaCode/genderize/issues) first in case your issue has already been raised\nby another Githuber\n\n## Documentation\n\nFull documentation is available here: http://rubydoc.info/gems/genderize\n\n## Contributing\n\nYou're welcome to contribute to Genderize.\n\n## Legal Stuff\n\nCopyright 2013 [Katana Code Ltd.](http://katanacode.com)\n\nSee [LEGAL](MIT-LICENSE) for full details.\n\n## Credits\n\nDeveloped by [Katana](http://katanacode.com)\n\n## About Katana\n\nKatana are [mobile and web app developers based in Edinburgh, Scotland](http://katanacode.com/ \"Katana\").\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodacious%2Fgenderize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodacious%2Fgenderize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodacious%2Fgenderize/lists"}