ret_d = 1 ret_d2 = 23
是否有返回[“ret_d”,“ret_d2”]的函数?问题是我没有所有变量的集合.
>> ret_d = 1 => 1 >> ret_d2 = 23 => 23 >> local_variables => ["_","ret_d","ret_d2"] >> local_variables.select{|v|v=~/^ret_/} => ["ret_d","ret_d2"]