Rubanok

screenshot of Rubanok
rails

Parameters-based transformation DSL

Overview

Rubanok is an innovative gem designed for Ruby developers who need a structured way to build parameters-based data transformers. It streamlines the process of manipulating collections for REST index actions, enabling filtering, sorting, searching, and pagination in a more efficient manner. With an emphasis on simplicity, Rubanok allows users to handle data inputs flexibly and intuitively, making it a great addition to your Ruby toolkit.

The core concept of Rubanok revolves around its processor, which is responsible for mapping incoming parameters to their respective transformations. This gem is suitable for various projects, whether you are using Ruby on version 2.7 or above, and it supports Rails starting from version 6.0, with older versions available for those using previous Rails releases.

Features

  • Nested Processors: Easily define sub-processors to manage nested parameters, allowing for more organized data processing.
  • Default Transformation: Set up initial transformations through a special prepare method, enhancing workflow flexibility.
  • Parameter Matching: Utilize the match method for value handling, allowing straightforward matching of input values.
  • Configurable Error Handling: Customize error responses using Rubanok.fail_when_no_matches, enabling refined control over input validation.
  • Dynamic Rule Activation: Activate rules based on parameter presence and define optional keys with activate_on and activate_always options.
  • Input Filtering: Prepare complex input types efficiently by applying filters before they reach transformation blocks, improving data integrity.
  • Scope Access: Use the #rubanok_scope method in Rails to retrieve and display the parameters used during the data processing to enhance user experience.
rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.