Is it possible to extend a class by using a string as a module ? - Ruby 2.7.1
问题 I am doing some tests with Ruby 2.7.1 on FreeBSD 12.1. I know how to extend a class with module with for instance this : class Myclass def mymethod extend Mymodule end end But is it possible to obtain the same result with something that looks like this : class Myclass def mymethod var = "Mymodule" extend var end end If I do this like that, I off-course obtain an error, since extend is pointing to a string and not a module. Here are some explanations - it would be useful in the following