I’m a Ruby beginner and I’m stuck with a doubt.
I want realize a sort of DSL that looks like:
require 'exampledsl'
method1 do
#...
end
method2 do
#...
end
Because these method aren’t part of Kernel module I can’t call them in
this way so I thought to pass the whole file using ‘load’ to the
methods’ class like:
Example.instance_eval { load "./example.rb" }
But I’m not sure if it’s ‘good practice’ or there’s a cleaner way.
I saw on Google but without results.