【发布时间】:2012-11-28 10:13:16
【问题描述】:
有谁知道如何将方法调用为字符串?例如:
case @setting.truck_identification
when "Make"
t.make
when "VIN"
t.VIN
when "Model"
t.model
when "Registration"
t.registration
.to_sym 似乎不起作用。
【问题讨论】:
-
这个问题是合法的,它是关于调用一个方法,因为它的名字在一个变量中。
标签: ruby