title: undefined method ... for class (NoMethodError)
body: <p>I'm just startin to learn ruby and I'm writing a simple program, but I've got an error <code>undefined method 'send_for_beer' for Person:Class (NoMethodError)</code>
  Here is a code:</p>
  
  <pre><code>class Person
      @iq = 0
      @speed = 0
      @power = 0
      @beauty = 0
      def initialize (iq, speed, power, beauty)
          @iq = iq
          @speed = speed
          @power = power
      end
  
      def send_for_beer
          result @iq * 2 + @speed * 10 + @power * 5 + @beauty
          return result
      end
  end
  
  number_of_people = 3
  person_array = Array.new(number_of_people, Person)
  n = 0
  beer_person = 0
  beer_cof = 0
  number_of_people.times do 
  
      ............
      person_array.push(Person.new(iq, speed, power, beauty))
  
      if person_array[n].send_for_beer &gt; beer_cof     &lt;-----here is an error
          beer_cof = person_array[n].send_for_beer
          beer_person = n
      end
      n = n+1
  end
  </code></pre>