if VARIABLE in ARRAY ruby
I thought this should work:
def setMethod(method)
if method in @@methods
... do something
end
end
But I keep getting keyword error for in
试试这个,假设@@methods
是一个数组:
if @@methods.include?(method)
# ...
end
链接地址: http://www.djcxy.com/p/25696.html
上一篇: 在JavaScript中比较对象的数组