{"id":13878696,"url":"https://github.com/iago-silva/service_it","last_synced_at":"2025-04-10T12:22:53.950Z","repository":{"id":41113847,"uuid":"182564764","full_name":"iago-silva/service_it","owner":"iago-silva","description":"[Service Objects] Simple gem to keep your controllers and models slim and readable","archived":false,"fork":false,"pushed_at":"2021-06-03T16:40:45.000Z","size":142,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:11:17.859Z","etag":null,"topics":["gem","rails","rails-generator","ruby","ruby-on-rails","service","service-object"],"latest_commit_sha":null,"homepage":"","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/iago-silva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-21T17:49:20.000Z","updated_at":"2024-07-31T19:29:57.000Z","dependencies_parsed_at":"2022-08-21T01:20:45.068Z","dependency_job_id":null,"html_url":"https://github.com/iago-silva/service_it","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/iago-silva%2Fservice_it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iago-silva%2Fservice_it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iago-silva%2Fservice_it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iago-silva%2Fservice_it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iago-silva","download_url":"https://codeload.github.com/iago-silva/service_it/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144793,"owners_count":21054989,"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":["gem","rails","rails-generator","ruby","ruby-on-rails","service","service-object"],"created_at":"2024-08-06T08:01:57.015Z","updated_at":"2025-04-10T12:22:53.932Z","avatar_url":"https://github.com/iago-silva.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# ServiceIt\n[![Gem Version](https://badge.fury.io/rb/service_it.svg)](https://badge.fury.io/rb/service_it) \n[![Build Status](https://travis-ci.org/iago-silva/service_it.svg?branch=master)](https://travis-ci.org/iago-silva/service_it)\n[![Code Climate](https://codeclimate.com/github/iago-silva/service_it.png)](https://codeclimate.com/github/iago-silva/service_it) \n\nFacilitate the creation of Service Objects, providing the basic and enough to have a complete one and letting you free to use on your own way.\n\n- [ServiceIt](#serviceit)\n  - [Installation](#installation)\n  - [With Bundler](#with-bundler)\n  - [Rails Generator](#rails-generator)\n  - [Usage](#usage)\n  - [Example](#example)\n\n## Installation\n\n    $ gem install service_it\n\n## With Bundler\n\nAdd this line to your `Gemfile`:\n\n    gem 'service_it', '~\u003e 2.0.0'\n\nAnd then execute:\n\n    $ bundle\n\n## Rails Generator\n\nYou can use Rails generator to create a `Service`\n\n    $ rails g service NAME\n\nThis will create:\n\n```\n├── app\n    ├── services\n        └── name.rb\n```\n\n## Usage\n\n```ruby\nclass Foo \u003c ServiceIt::Base\n  def perform\n    # put your logic here\n    # you can use params that became variables\n  end\nend\n```\n\nCall your service from anywhere (controllers, models, migrations...)\n\n```ruby\nFoo.call(foo: foo, bar: bar)\n```\n\n## Example\n\n```ruby\n# app/services/release_post.rb\nclass ReleasePost \u003c ServiceIt::Base\n  def perform\n    post.prepare_to_release\n    post.update(released_at: Date.current)\n  end\nend\n```\n\n```ruby\nReleasePost.call(post: @post)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiago-silva%2Fservice_it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiago-silva%2Fservice_it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiago-silva%2Fservice_it/lists"}