Hi...
Consider...
···
-----------------------------------------------
module Mymodule
def call_test1
printf "test1"
end
module_function :call_test1
def call_test2
printf "test2"
end
module_function :call_test2
def functions
h = Hash.new
Mymodule.methods.grep(/^call/).each do |f|
h[f]=Mymodule.method(f)
end
h
end
module_function :functions
end
calls = Mymodule::functions
calls.keys.each do |thisone|
calls[thisone].call
puts " #{thisone}"
end
-----------------------------------------------
Q: How to optimize/automate the lines
module_function :call_test1
module_function :call_test2
away, too? (since we know all call_* are the same type and want to
remove that hand typed error source)
tnx!
Martin