I am writing a simple dsl in ruby. A few weeks ago, I came across some blog posts that showed how to convert code, for example:
some_method argument do |book| book.some_method_on_book book.some_other_method_on_book :with => argument end
in clean code:
some_method argument do some_method_on_book some_other_method_on_book :with => argument end
I donβt remember how to do this, and I'm not sure about the flaws, but the cleaner syntax is tempting. Does anyone know about this conversion?
ruby block dsl
dhuCerbin
source share