Operandi
Operandi is a simple yet powerful way to organize business logic in Ruby applications. Build services that are easy to test, maintain, and understand.
Features
β¨ Simple: Define your service as a class with
arguments,steps, andoutputsπ¦ No runtime dependencies: Works stand-alone without requiring external gems at runtime
π Transactions: Automatically rollback database changes if any step fails
𧬠Inheritance: Inherit from other services to reuse logic seamlessly
β οΈ Error Handling: Collect errors from steps and handle them your way
π Context: Run multiple services sequentially within the same context
π§ͺ RSpec Matchers: Built-in RSpec matchers for expressive service tests
π RuboCop Integration: Custom cops to enforce best practices at lint time
π Framework Agnostic: Compatible with Rails, Hanami, or any Ruby framework
π§© Modularity: Isolate and test your services with ease
π· Sorbet & Tapioca: Full support for Sorbet type checking and Tapioca DSL generation
β 100% Test Coverage: Thoroughly tested and reliable
βοΈ Battle-Tested: In production use since 2017
Simple Example
Advanced Example (with Sorbet types and conditions)
Last updated