[Solved] Check if item is included in an array or hash [closed]


You can use the include? method of ruby’s Array

if ['trail', 'active'].include?(@subscription.state)
  #do something
end

solved Check if item is included in an array or hash [closed]