A functional, Ruby DSL for casting, transforming and transposing objects
This package provides a functional, Ruby Domain-Specific Language (DSL) for casting, transforming and transposing objects.
The project's README file provides the following explanation of the purpose of this library:
Casting complex objects from one type to another can be an uncomfortable process to express well. Objects that we use on a daily basis are not always in our control, and, even when they are, some don't lend themselves to simple construction. Remote service communication objects or complex data structures from libraries we use in our applications can result in large piles of casting code.
This circumstance often produces large swaths of procedural code, even if split up into separate function calls. This code can be not only difficult to understand, but difficult to test if an object requires a great deal of set up. Field or method assignments midway through can change and break the entire operation.
The goal of this project is to provide a method of defining easily digestible specifications for object translation that are also easily testable and changeable. The project focuses on writing specifications for transformations and not doing direct mutation in the recipes. The result is something that should seem somewhat functional, but also exceedingly separable.
Download version 0.4b
This entry (in part or in whole) was last reviewed on 3 January 2014.