title: How can I use a instance variable to accomplish the same task?
body: <p>Here I use a global variable to store a list because I can't figure out how I can keep ahold of a list long enough to check its values for duplicates. </p>
  
  <pre><code>$list = []
  def hand_out_gift(name)
    if $list.include?name 
      puts "No present for you"
    else 
      $list.push(name)
    end
  end
  
  hand_out_gift("Peter")
  hand_out_gift("Alison")
  hand_out_gift("John")
  hand_out_gift("Maria")
  hand_out_gift("Peter")
  </code></pre>
  
  <p>How can I accomplish the same check with an instance variable?</p>