Flexible and reversible transforms in ruby using a declarative dsl