About Array

Hi. First look at my codes please.

names = ["Jack", "Nichole", "Emma"]
print "Please write your name:"
name = gets.chop
if name == names   #I've tried this (if name == names[0,1,2])
    puts "Correct user!"
    puts "Wrong User!"

I want the program to look inside the array values. But it’s not working.

Change the if line to if names.include?(name)

Thank you very much.