Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronmallen/activeinteractor
An implementation of the command pattern for Ruby with ActiveModel::Validations inspired by the interactor gem. Rich support for attributes, callbacks, and validations, and thread safe performance methods.
https://github.com/aaronmallen/activeinteractor
command-pattern interactor-rails rails ruby ruby-interactors rubygem rubyonrails
Last synced: 25 days ago
JSON representation
An implementation of the command pattern for Ruby with ActiveModel::Validations inspired by the interactor gem. Rich support for attributes, callbacks, and validations, and thread safe performance methods.
- Host: GitHub
- URL: https://github.com/aaronmallen/activeinteractor
- Owner: aaronmallen
- License: mit
- Created: 2019-03-23T18:02:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T07:07:25.000Z (8 months ago)
- Last Synced: 2024-09-30T07:06:04.216Z (about 1 month ago)
- Topics: command-pattern, interactor-rails, rails, ruby, ruby-interactors, rubygem, rubyonrails
- Language: Ruby
- Homepage:
- Size: 468 KB
- Stars: 176
- Watchers: 3
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# ActiveInteractor
[![Version](https://img.shields.io/gem/v/activeinteractor.svg?logo=ruby)](https://rubygems.org/gems/activeinteractor)
[![Build Status](https://github.com/aaronmallen/activeinteractor/workflows/Build/badge.svg)](https://github.com/aaronmallen/activeinteractor/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/2f1cb318f681a1eebb27/maintainability)](https://codeclimate.com/github/aaronmallen/activeinteractor/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/2f1cb318f681a1eebb27/test_coverage)](https://codeclimate.com/github/aaronmallen/activeinteractor/test_coverage)
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://www.rubydoc.info/gems/activeinteractor)
[![Inline docs](http://inch-ci.org/github/aaronmallen/activeinteractor.svg?branch=main)](http://inch-ci.org/github/aaronmallen/activeinteractor)
[![License](https://img.shields.io/github/license/aaronmallen/activeinteractor.svg?maxAge=300)](https://github.com/aaronmallen/activeinteractor/blob/main/LICENSE)An implementation of the [command pattern] for Ruby with [ActiveModel::Validations] inspired by the
[interactor][collective_idea_interactors] gem. Rich support for attributes, callbacks, and validations,
and thread safe performance methods.Reduce controller bloat with procedural service objects. Checkout this [Medium article] for a crash
course on how to use ActiveInteractors. Read the [wiki] for detailed usage information.## Features
* [Context validation][wiki_context_validation]
* [Callbacks][wiki_callbacks]
* Thread safe performance calls
* Organize multiple interactors [conditionally][wiki_organizers_conditionally] or in [parallel][wiki_organizers_parallel]## Documentation
Be sure to read the [wiki] for detailed information on how to use ActiveInteractor.
For technical documentation please see the gem's [ruby docs].
## Install
Add this line to your application's Gemfile:
```ruby
gem 'activeinteractor', require: 'active_interactor'
```Or install it yourself as:
```sh
gem install activeinteractor
```## Contributing
Read our guidelines for [Contributing](CONTRIBUTING.md).
## Acknowledgements
ActiveInteractor is made possible by wonderful [humans].
## License
The gem is available as open source under the terms of the [MIT License][mit_license].
[ActiveModel::Validations]: https://api.rubyonrails.org/classes/ActiveModel/Validations.html
[business_logic_wikipedia]: https://en.wikipedia.org/wiki/Business_logic
[collective_idea_interactors]: https://github.com/collectiveidea/interactor
[command pattern]: https://en.wikipedia.org/wiki/Command_pattern
[humans]: https://github.com/aaronmallen/activeinteractor/tree/main/HUMANS.md
[Medium article]: https://medium.com/@aaronmallen/activeinteractor-8557c0dc78db
[mit_license]: https://opensource.org/licenses/MIT
[ruby docs]: https://www.rubydoc.info/gems/activeinteractor
[wiki]: https://github.com/aaronmallen/activeinteractor/wiki
[wiki_callbacks]: https://github.com/aaronmallen/activeinteractor/wiki/Callbacks
[wiki_context_validation]: https://github.com/aaronmallen/activeinteractor/wiki/Context#validating-the-context
[wiki_organizers_conditionally]: https://github.com/aaronmallen/activeinteractor/wiki/Interactors#organizing-interactors-conditionally
[wiki_organizers_parallel]: https://github.com/aaronmallen/activeinteractor/wiki/Interactors#running-interactors-in-parallel