{"id":15510356,"url":"https://github.com/nowlinuxing/minenum","last_synced_at":"2025-08-04T12:12:09.665Z","repository":{"id":235108834,"uuid":"790093760","full_name":"nowlinuxing/minenum","owner":"nowlinuxing","description":"Add the function to return an enum object to ruby objects.","archived":false,"fork":false,"pushed_at":"2024-06-06T03:39:57.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T03:49:14.835Z","etag":null,"topics":["enum","ruby"],"latest_commit_sha":null,"homepage":"","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/nowlinuxing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-22T08:52:37.000Z","updated_at":"2024-06-06T03:39:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"7edb57e5-f225-4932-b1b9-25cd9f9fe2a0","html_url":"https://github.com/nowlinuxing/minenum","commit_stats":null,"previous_names":["nowlinuxing/minenum"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nowlinuxing/minenum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowlinuxing%2Fminenum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowlinuxing%2Fminenum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowlinuxing%2Fminenum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowlinuxing%2Fminenum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowlinuxing","download_url":"https://codeload.github.com/nowlinuxing/minenum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowlinuxing%2Fminenum/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268695240,"owners_count":24291995,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["enum","ruby"],"created_at":"2024-10-02T09:47:58.306Z","updated_at":"2025-08-04T12:12:09.657Z","avatar_url":"https://github.com/nowlinuxing.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maintainability](https://api.codeclimate.com/v1/badges/04440479daa0ecea68de/maintainability)](https://codeclimate.com/github/nowlinuxing/minenum/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/04440479daa0ecea68de/test_coverage)](https://codeclimate.com/github/nowlinuxing/minenum/test_coverage)\n\n# Minenum\n\nMinenum is a gem that enhances Ruby objects by adding enum functionality and returning enum objects as return values. Enums simplify representing states or types within a specific range of values and can be returned directly from methods.\n\nFeatures:\n\n* Return enum objects directly from methods, enabling clearer and more expressive code.\n* Simplify code by encapsulating valid value ranges within enums.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add minenum\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install minenum\n\n## Usage\n\n```ruby\nclass Shirt\n  include Minenum::Model\n\n  enum :size, { small: 1, medium: 2, large: 3 }\nend\n```\n\n```ruby\nshirt = Shirt.new\nshirt.size = 1\nshirt.size.name #=\u003e :small\nshirt.size.small? #=\u003e true\n\n# You can also set the name\nshirt.size = :medium\nshirt.size.name #=\u003e :medium\nshirt.size.medium? #=\u003e true\n\n# Call bang method to change the enum value\nshirt.size.small!\nshirt.size.small? #=\u003e true\n```\n\n```ruby\n# You can get the enum values\nShirt.size.values #=\u003e { small: 1, medium: 2, large: 3 }\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nowlinuxing/minenum.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowlinuxing%2Fminenum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowlinuxing%2Fminenum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowlinuxing%2Fminenum/lists"}