They're called Embedded Domain-Specific Languages, Ruby is used quite often for the same purposes.
If you're interested in the subject, then I'd recommend Martin Fowler's excellent book: http://martinfowler.com/books/dsl.html
If you're interested in the subject, then I'd recommend Martin Fowler's excellent book: http://martinfowler.com/books/dsl.html