I have a DSL in Ruby that works like so:
desc \'list all todos\' command :list do |c| c.desc \'show todos in long form\' c.switch :l c.action do |globa
Paste this code:
def evaluate(&block) @self_before_instance_eval = eval "self", block.binding instance_eval &block end def method_missing(method, *args, &block) @self_before_instance_eval.send method, *args, &block end
For more information, refer to this really good article here