title: Undefined method 'each' for Student:Class
body: <p>I want to load a file, split its content into arrays, and have the class apply to the content.</p>
  
  <pre><code>class Student
      def initialize( name, grade )
          @name = name
          @grade = grade
          @grade = @grade.to_i
          @newgrade = @grade*1.45
      end
  
      def show()
          return "#{@name} ,#{@grade} , #{@newgrade}" 
      end
  end
  
  # Opening the file into an array
  arr = File.open("exam_results.txt", "r+")
  allStudents = Array.new
  
  for a in arr
      b = a.split(",")
      name = b[0]
      score = b[1]
      allStudents &lt;&lt; Student.new(@name, @grade)
  end
  
  for i in Student
      puts show()
  end
  </code></pre>
  
  <p>I'm getting</p>
  
  <blockquote>
    <p>undefined method 'each' for Student:Class (NoMethodError)</p>
  </blockquote>
  
  <p>on line 28, which is the <code>puts show()</code> line. Any clues on how I can get further on this?</p>