我在 IRB 上试过这个,但找不到解决方案:
irb(main):001:0> STATUS = %w(draft public)
=> ["draft", "public"]
irb(main):003:0> s = "draft"
=> "draft"
irb(main):004:0> s.include?(STATUS)
TypeError: can't convert Array into String
from (irb):4:in `include?'
from (irb):4
from /Users/SO/.rbenv/versions/1.9.3-p374/bin/irb:12:in `<main>'
怎么了?谢谢。