I\'m writing a small gem, and I want to define a DSL-like method, pretty much the same as the desc
and task
methods in Rake.
R
If you define private method in Kernel
module it will be available in the whole project. You will also rewrite desc
method that project use to define rake task. But if you write your methods in your submodule and then extend it in superclass or some module - you can easily write any kind of DSL lang like you might saw in Rake
or RSpec
.
P.S. Making methods private
prevents other moludes or classes (but not subclasses) to use them (but not owerwrite) - I mean module nesting hierarchy.