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.

Get started with Quickstart

Features

  • ✨ Simple: Define your service as a class with arguments, steps, and outputs

  • πŸ“¦ 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)

Get started with Operandi

Last updated