title: Question about "gets" in ruby
body: <p>I was wondering why when I'm trying to gets to different inputs that it ignores the second input that I had.</p>
  
  <pre><code>#!/usr/bin/env ruby
  #-----Class Definitions----
  
  class Animal
    attr_accessor :type, :weight
  end
  
  class Dog &lt; Animal
    attr_accessor :name
    def speak
      puts "Woof!"
    end
  end
  
  #-------------------------------
  
  puts
  puts "Hello World!"
  puts
  
  new_dog = Dog.new
  
  print "What is the dog's new name? "
  name = gets
  puts
  
  print "Would you like #{name} to speak? (y or n) "
  speak_or_no = gets
  
  while speak_or_no == 'y'
    puts
    puts new_dog.speak
    puts
    puts "Would you like #{name} to speak again? (y or n) "
    speak_or_no = gets
  end
  
  puts
  puts "OK..."
  
  gets
  </code></pre>
  
  <p>As you can see it completely ignored my while statement.</p>
  
  <p>This is a sample output.</p>
  
  <pre><code>Hello World!
  
  What is the dog's new name? bob
  
  Would you like bob
   to speak? (y or n) y
  
  OK...
  </code></pre>