ruby - I don't know how to call a random method from an existing method -
For example, I have a class with 4 methods. In the fourth method, I want to call a random method:
class test df for the first time "1" end DEP seconds "2" End DEP third "3" end DEF some end-end tests = test.new test.some
< Pre> class test df first puts "define" DEF "second" end DEF returns some public_send (self.class.instance_methods (false) - [__method __]). Sample End End Test = test.new test.some # & gt; & Gt; 1
Comments
Post a Comment