{"id":16054100,"url":"https://github.com/yujideveloper/rekkyo","last_synced_at":"2025-09-10T17:32:10.457Z","repository":{"id":44883491,"uuid":"160779029","full_name":"yujideveloper/rekkyo","owner":"yujideveloper","description":"Enumerated type in Ruby","archived":false,"fork":false,"pushed_at":"2024-02-19T02:51:09.000Z","size":77,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T19:31:15.443Z","etag":null,"topics":["enum","enumerated-types","ruby"],"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/yujideveloper.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":"2018-12-07T06:07:43.000Z","updated_at":"2024-08-05T10:27:26.000Z","dependencies_parsed_at":"2024-02-19T03:45:57.307Z","dependency_job_id":null,"html_url":"https://github.com/yujideveloper/rekkyo","commit_stats":{"total_commits":98,"total_committers":1,"mean_commits":98.0,"dds":0.0,"last_synced_commit":"f4232ed70ab8928b07b34677d98ba5a8623ae846"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frekkyo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frekkyo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frekkyo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frekkyo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujideveloper","download_url":"https://codeload.github.com/yujideveloper/rekkyo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232548607,"owners_count":18540145,"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":["enum","enumerated-types","ruby"],"created_at":"2024-10-09T02:01:24.512Z","updated_at":"2025-01-05T04:56:26.963Z","avatar_url":"https://github.com/yujideveloper.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rekkyo\n\n[![Gem Version](https://badge.fury.io/rb/rekkyo.svg)](https://badge.fury.io/rb/rekkyo)\n[![Build](https://github.com/yujideveloper/rekkyo/actions/workflows/ruby.yml/badge.svg)](https://github.com/yujideveloper/rekkyo/actions/workflows/ruby.yml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/37d6334cedf5b04af831/maintainability)](https://codeclimate.com/github/yujideveloper/rekkyo/maintainability)\n\nRekkyo (列挙) is a gem for defining an enumerated type in Ruby.\n\nThis gem is inspired by [`ruby-enum`](https://rubygems.org/gems/ruby-enum) and [`enum_class`](https://rubygems.org/gems/enum_class).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rekkyo'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rekkyo\n\n## Usage\n\n### Basic usage\n\n``` ruby\nclass Color\n  include Rekkyo::Type\n\n  member :RED\n  member :GREEN\n  member :BLUE\nend\n\n{ color: Color::RED }.to_json # =\u003e \"{\\\"color\\\":\\\"RED\\\"}\n\nColor::RED.red?   # =\u003e true\nColor::BLUE.blue? # =\u003e false\n\nColor::RED == Color::RED   # =\u003e true\nColor::RED == Color::BLUE  # =\u003e false\nColor::RED == :RED         # =\u003e false\nColor::RED == \"RED\"        # =\u003e false\n\nColor::RED === Color::RED  # =\u003e true\nColor::RED === Color::BLUE # =\u003e false\nColor::RED === :RED        # =\u003e true\nColor::RED === \"RED\"       # =\u003e true\n\nColor::RED.match?(Color::RED)  # =\u003e true\nColor::RED.match?(Color::BLUE) # =\u003e false\nColor::RED.match?(:RED)        # =\u003e true\nColor::RED.match?(\"RED\")       # =\u003e true\n\ncase \"RED\"\nwhen Color::RED   then \"#FF0000\"\nwhen Color::BLUE  then \"#00FF00\"\nwhen Color::GREEN then \"#0000FF\"\nelse                   \"Unkown\"\nend\n# =\u003e \"#FF0000\"\n```\n\n### Custom value\n\n``` ruby\nclass Color\n  include Rekkyo::Type\n\n  member :RED,   \"#FF0000\"\n  member :GREEN, \"#00FF00\"\n  member :BLUE,  \"#0000FF\"\nend\n\nColor::RED.red?   # =\u003e true\nColor::BLUE.blue? # =\u003e false\n\n{ color: Color::RED }.to_json # =\u003e \"{\\\"color\\\":\\\"#FF0000\\\"}\"\n\nColor::RED == Color::RED   # =\u003e true\nColor::RED == Color::BLUE  # =\u003e false\nColor::RED == :\"#FF0000\"   # =\u003e false\nColor::RED == \"#FF0000\"    # =\u003e false\n\nColor::RED === Color::RED  # =\u003e true\nColor::RED === Color::BLUE # =\u003e false\nColor::RED === :\"#FF0000\"  # =\u003e true\nColor::RED === \"#FF0000\"   # =\u003e true\n\nColor::RED.match?(Color::RED)  # =\u003e true\nColor::RED.match?(Color::BLUE) # =\u003e false\nColor::RED.match?(:\"#FF0000\")  # =\u003e true\nColor::RED.match?(\"#FF0000\")   # =\u003e true\n\ncase \"#FF0000\"\nwhen Color::RED   then \"RED\"\nwhen Color::BLUE  then \"BLUE\"\nwhen Color::GREEN then \"GREEN\"\nelse                   \"Unkown\"\nend\n# =\u003e \"RED\"\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 tags, 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/yujideveloper/rekkyo.\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%2Fyujideveloper%2Frekkyo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujideveloper%2Frekkyo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Frekkyo/lists"}