{"id":16390006,"url":"https://github.com/mnishiguchi/config_bitset","last_synced_at":"2026-06-25T10:31:05.852Z","repository":{"id":84540646,"uuid":"122557339","full_name":"mnishiguchi/config_bitset","owner":"mnishiguchi","description":null,"archived":false,"fork":false,"pushed_at":"2018-02-23T05:20:16.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T14:23:25.505Z","etag":null,"topics":["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/mnishiguchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-02-23T01:24:05.000Z","updated_at":"2018-11-09T11:41:08.000Z","dependencies_parsed_at":"2023-03-05T14:30:39.851Z","dependency_job_id":null,"html_url":"https://github.com/mnishiguchi/config_bitset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fconfig_bitset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fconfig_bitset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fconfig_bitset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnishiguchi%2Fconfig_bitset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnishiguchi","download_url":"https://codeload.github.com/mnishiguchi/config_bitset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240221295,"owners_count":19767442,"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":["ruby"],"created_at":"2024-10-11T04:34:45.706Z","updated_at":"2026-06-09T15:30:17.171Z","avatar_url":"https://github.com/mnishiguchi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConfigBitset\n- Provides an abstract class that implements utility methods for managing config flags.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'config_bitset', github: 'mnishiguchi/config_bitset', branch: 'master'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\n```rb\n# Represents a set of configuration flags for amenities.\nclass AmenityConfig \u003c ConfigBitset::Base\n  define_flag :washer_dryer, 1, \"Washer/Dryer\"\n  define_flag :dishwasher,   2, \"\"\n  define_flag :ac,           4, \"A/C\"\n  define_flag :balcony,      5, \"\"\n  define_flag :fireplace,    6, \"\"\nend\n\nAmenityConfig.list\n# =\u003e [{:name=\u003e\"washer_dryer\", :value=\u003e2, :display_name=\u003e\"Washer/Dryer\"}, {:name=\u003e\"dishwasher\", :value=\u003e4, :display_name=\u003e\"Dishwasher\"}, {:name=\u003e\"ac\", :value=\u003e 16, :display_name=\u003e\"A/C\"}, {:name=\u003e\"balcony\", :value=\u003e32, :display_name=\u003e\"Balcony\"}, {:name=\u003e\"fireplace\", :value=\u003e64, :display_name=\u003e\"Fireplace\"}]\nconfig = AmenityConfig.new\n#=\u003e #\u003cAmenityConfig:0x00007f83bc3e6858 @state=0\u003e\nconfig.ac?\n#=\u003e false\nconfig.ac = true\n#=\u003e true\nconfig.ac?\n#=\u003e true\nconfig.dishwasher = true\n#=\u003e true\nconfig.to_a\n#=\u003e [{:name=\u003e\"dishwasher\", :value=\u003e4, :display_name=\u003e\"Dishwasher\"}, {:name=\u003e\"ac\", :value=\u003e16, :display_name=\u003e\"A/C\"}]\nconfig.to_i\n#=\u003e 20\nconfig.to_s\n#=\u003e \"10100\"\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/mnishiguchi/config_bitset.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnishiguchi%2Fconfig_bitset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnishiguchi%2Fconfig_bitset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnishiguchi%2Fconfig_bitset/lists"}