Building DSL with Ruby
The DSL shortcut stands for Domain Specific Language. At first glance, it might sound a little bit mysterious, but the truth is you use it daily as a Ruby.In the above example, the “Domain-specific” means the routes definition. Rails provides a special language (which is, of course, Ruby code) to allow you to define routes more efficiently. Instead of the complex definition with request types, path, and params, you can just use the resources method, and all the parsing is done under the hood.This article will cover more examples and show you how you can build your DSL from scratch.
Building DSL with Ruby #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper