{"id":18137961,"url":"https://github.com/rickbutton/has-properties","last_synced_at":"2025-04-19T17:45:24.526Z","repository":{"id":5852322,"uuid":"7068993","full_name":"rickbutton/has-properties","owner":"rickbutton","description":"Gem that provides an easy way to create basic objects with properties","archived":false,"fork":false,"pushed_at":"2012-12-08T16:07:42.000Z","size":113,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T02:47:59.223Z","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":"rroblak/seed_dump","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rickbutton.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}},"created_at":"2012-12-08T15:43:19.000Z","updated_at":"2013-10-01T06:12:36.000Z","dependencies_parsed_at":"2022-09-09T17:01:06.633Z","dependency_job_id":null,"html_url":"https://github.com/rickbutton/has-properties","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/rickbutton%2Fhas-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickbutton%2Fhas-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickbutton%2Fhas-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickbutton%2Fhas-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickbutton","download_url":"https://codeload.github.com/rickbutton/has-properties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249751975,"owners_count":21320404,"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-01T15:07:50.275Z","updated_at":"2025-04-19T17:45:24.510Z","avatar_url":"https://github.com/rickbutton.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# has-properties\n\n`has_properties` provides an easy way to create basic class definitions with properties. \nIt essentially wraps a lot of `attr_(reader/writer/accessor)` calls into a neat package\nwith a nifty initializer.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'has-properties'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install has-properties\n\n## Usage Example\n\n1. Include the `HasProperties` module\n2. Define your properties\n3. ??????\n4. Profit?\n\n```\n    class Example\n      include HasProperties\n    \n      has_read_properties :readable, :another_readable\n      has_write_properties :writable, :another_writable\n      has_properties :readable_and_writable\n    end\n    \n    e = Example.new(:readable =\u003e 1, :writable =\u003e 2, :readable_and_writable =\u003e 3)\n```\n```\n    e.readable\n    =\u003e 1\n```\n```\n    e.readable = 2\n    =\u003e NoMethodError\n```\n```\n    e.writable\n    =\u003e NoMethodError\n```\n```\n    e.writable = 3\n    =\u003e 3\n```\n```\n    e.readable_and_writable\n    =\u003e 3\n```\n```\n    e.readable_and_writable = 4\n    =\u003e 4\n```\n\n### Some notes\n\nYou don't have to include every property in the initializer hash. For example, the example above\ndefines the `:another_readable` property, but it was never initialized when the object was created.\nThis means that a call to `e.another_readable` would equal `nil`.\n\n```\n    e.another_readable\n    =\u003e nil\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickbutton%2Fhas-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickbutton%2Fhas-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickbutton%2Fhas-properties/lists"}