{"id":19237187,"url":"https://github.com/falm/the_rules","last_synced_at":"2025-02-23T13:50:13.143Z","repository":{"id":148701848,"uuid":"134941028","full_name":"falm/the_rules","owner":"falm","description":"simple rules engine for ruby","archived":false,"fork":false,"pushed_at":"2018-06-20T11:20:18.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-31T13:03:33.816Z","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/falm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-26T07:52:34.000Z","updated_at":"2018-10-31T09:57:08.000Z","dependencies_parsed_at":"2023-05-28T17:00:36.240Z","dependency_job_id":null,"html_url":"https://github.com/falm/the_rules","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/falm%2Fthe_rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falm%2Fthe_rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falm%2Fthe_rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falm%2Fthe_rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/falm","download_url":"https://codeload.github.com/falm/the_rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324060,"owners_count":19783453,"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-09T16:25:14.965Z","updated_at":"2025-02-23T13:50:13.118Z","avatar_url":"https://github.com/falm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TheRules\n\n**the_rules** is ruby simple rules engine\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'the_rules'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install the_rules\n\n## Usage\n\n### Basic\n\n```ruby\nrequire 'the_rules'\nclass ServiceObject\n  include TheRules\n\n  rule \"age \u003e 18 should be works\" do\n\n    when? do |data|\n      data[:age] \u003e= 18\n    end\n\n    then! do |data|\n      do_something(data[:name])\n    end\n\n  end\n\n  rule \"married\" do\n    when? do |data|\n      data[:married]\n    end\n\n    then! do\n      'Bye!'\n    end\n  end\n\n  def call\n    process_rules {name: 'joe', age: 25, married: true}\n  end\n\nend\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/falm/the_rules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalm%2Fthe_rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalm%2Fthe_rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalm%2Fthe_rules/lists"}