{"id":25031730,"url":"https://github.com/mariomarroquim/rails_application_service","last_synced_at":"2025-11-11T18:39:30.108Z","repository":{"id":275752941,"uuid":"927083715","full_name":"mariomarroquim/rails_application_service","owner":"mariomarroquim","description":"Service objects for Rails - the Rails way","archived":false,"fork":false,"pushed_at":"2025-08-16T20:17:09.000Z","size":95,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-08T06:16:04.223Z","etag":null,"topics":["ruby","ruby-on-rails","services"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rails_application_service","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/mariomarroquim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2025-02-04T11:29:14.000Z","updated_at":"2025-08-16T20:17:12.000Z","dependencies_parsed_at":"2025-04-13T18:13:28.906Z","dependency_job_id":"ca8e8456-74e6-4e8d-bc74-14077ee4e8e2","html_url":"https://github.com/mariomarroquim/rails_application_service","commit_stats":null,"previous_names":["mariomarroquim/application_service","mariomarroquim/rails_application_service"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mariomarroquim/rails_application_service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarroquim%2Frails_application_service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarroquim%2Frails_application_service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarroquim%2Frails_application_service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarroquim%2Frails_application_service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariomarroquim","download_url":"https://codeload.github.com/mariomarroquim/rails_application_service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarroquim%2Frails_application_service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283910127,"owners_count":26915128,"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","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","ruby-on-rails","services"],"created_at":"2025-02-05T22:44:14.315Z","updated_at":"2025-11-11T18:39:30.102Z","avatar_url":"https://github.com/mariomarroquim.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails Application Service\n\nService objects for Rails, the Rails way. This Ruby gem adds service objects to your Rails applications.\n\n## Installation\n\n**1 - Add the gem to your Rails application's Gemfile:**\n\n```bash\nbundle add rails_application_service\n```\n\n**2 - Install the gem by running:**\n\n```bash\nbundle install\n```\n\n**3 - Create an `app/services` directory in your Rails application:**\n\n```bash\nmkdir -p app/services\n```\n\n## Usage\n\nThe `ApplicationService::Base` class provides a standard interface for calling service objects. It leverages `ActiveModel` for initialization with keyword arguments and input validation.\n\n### Basic service example\n\n```ruby\nclass MyService \u003c ApplicationService::Base\n  def call\n    # Perform the service action\n  end\nend\n\nmy_service = MyService.call # nil\n```\n\n### Example with attributes and validations\n\n```ruby\nclass Sum \u003c ApplicationService::Base\n  attr_accessor :number_a, :number_b\n\n  validates :number_a, :number_b, presence: true, numericality: { greater_than: 0 }\n\n  def call\n    number_a + number_b\n  end\nend\n\nsum = Sum.call(number_a: 1, number_b: 2) # =\u003e 3\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to execute the tests. You can also run `bin/console` for an interactive prompt 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`, then run `bundle exec rake release`. This will create a git tag for the version, push git commits and the tag, 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/mariomarroquim/rails_application_service. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/mariomarroquim/rails_application_service/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the ApplicationService project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [code of conduct](https://github.com/mariomarroquim/rails_application_service/blob/main/CODE_OF_CONDUCT.md).\n\n## Support\n\nYou can contact me at mariomarroquim@gmail.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomarroquim%2Frails_application_service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariomarroquim%2Frails_application_service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomarroquim%2Frails_application_service/lists"}