I need to dynamically call a class method (i.e., unless there is some
other way, the name of the class method should be contained in a
variable). I have come up with the way illustrated in the example shown
below. The program is in the file, ‘test1’. The relevant method is in
the file, ‘Test1a.rb’. I use ‘eval’ which (I believe) is frowned upon.
Does anyone have a better way of accomplishing this objective? Thanks
for any input.
$ cat Test1a.rb
return ‘Hello, world!’
$ cat test1