Tag: Ruby

Writing your own DSL with Ruby

I am a big fan of Ruby. There are so many beautiful libraries out there and most of them are based on some kind of domain specific language. Take builder as an example: Builder::XmlMarkup.new.person { |b| b.name("Jim"); b.phone("555-1234") } #=> <person><name>Jim</name><phone>555-1234</phone></person> Generating XML in this manner is pretty cool! There is no crazy XML editor […]