我想做
@array_object.factets
此@array_object
属于Class A
class A
factets = ['c','d','e']
end
Class A
未继承任何Active record
答案 0 :(得分:0)
如果没有必要调用变量那么你可以很容易地做到:
class A
def factets
['c','d','e']
end
end
然后:
@array_object = A.new
@array_object.factets
单行代码的OR:
@array_object = A.new.factets