新手问题 Ruby eval 是什么意思

ThanksSirAlec · January 05, 2018 · Last by kevinyu replied at January 06, 2018 · 1813 hits
eval(File.read(file))

如题,eval 这个找了半天没找到官方说明,不知道是干什么用的,有大佬能解释一下或者给个链接吗

就是把字符串当做代码来执行

eval is evil

eval is not evil by itself, its a method like other methods.😉

You need to Sign in before reply, if you don't have an account, please Sign up first.