如何动态创建局部变量?
我有一个变量var = "some_name"我想要创建一个新的对象并将它分配给some_name..我该怎么做?例如:
var = "some_name"
some_name
var = "some_name"some_name = Struct.new(:name) # I need thisa = some_name.new('blah') # so that I can do this.
HUH函数
相关分类