{"id":15405627,"url":"https://github.com/krisleech/inverse-attr","last_synced_at":"2025-07-31T19:34:40.523Z","repository":{"id":8041206,"uuid":"9451448","full_name":"krisleech/inverse-attr","owner":"krisleech","description":"Macro to create inverted attributes","archived":false,"fork":false,"pushed_at":"2015-02-04T09:40:23.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T04:44:46.128Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krisleech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-15T15:10:32.000Z","updated_at":"2015-02-04T09:40:23.000Z","dependencies_parsed_at":"2022-09-08T23:10:59.462Z","dependency_job_id":null,"html_url":"https://github.com/krisleech/inverse-attr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisleech%2Finverse-attr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisleech%2Finverse-attr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisleech%2Finverse-attr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisleech%2Finverse-attr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krisleech","download_url":"https://codeload.github.com/krisleech/inverse-attr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245359248,"owners_count":20602322,"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-10-01T16:17:33.986Z","updated_at":"2025-03-24T21:41:13.842Z","avatar_url":"https://github.com/krisleech.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InverseAttr\n\n[![Gem Version](https://badge.fury.io/rb/inverse-attr.png)](http://badge.fury.io/rb/inverse-attr)\n[![Code Climate](https://codeclimate.com/github/krisleech/inverse-attr.png)](https://codeclimate.com/github/krisleech/inverse-attr)\n[![Build Status](https://travis-ci.org/krisleech/inverse-attr.png?branch=master)](https://travis-ci.org/krisleech/inverse-attr)\n[![Coverage Status](https://coveralls.io/repos/krisleech/inverse-attr/badge.png?branch=master)](https://coveralls.io/r/krisleech/inverse-attr?branch=master)\n\nProvides a macro which adds methods to return the inverse of another.\n\n## Installation\n\n```ruby\ngem 'inverse_attr'\n```\n\n## Usage\n\n```ruby\nclass Lesson\n  include InverseAttr\n\n  def published?\n    false\n  end\n\n  attr_inverse :published?\nend\n\nlesson = Lesson.new\n\nlesson.not_published? # =\u003e true\n```\n\nYou can specify the name of the inverted attribute by passing a second argument:\n\n```ruby\nattr_inverse :published?, :draft?\n```\n\nDon't want to put the include at the top of your classes?\n\n```ruby\nObject.class_eval { include InverseAttr }\n```\n\nor more selectively:\n\n```ruby\nActiveRecord::Base.class_eval { include InverseAttr }\n```\n\n## License\n\nCopyright (c) 2013 Kris Leech\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisleech%2Finverse-attr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrisleech%2Finverse-attr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisleech%2Finverse-attr/lists"}