About scope in Ruby local and instance/class variables?
<p>I have a script for a simulation I'm working on:</p>

<pre><code>  def winner_client
    clients = [@client1, @client2, @client3]
    @winner = clients.find { |drunkest| drunkest.drunk == 3 }.name
    puts "#{@winner} is too drunk!"
    Bouncer.kick(@winner)
  end
end
</code></pre>

<p>In the <code>winner_client</code> method, I want the <code>clients</code> array to work at the class level so I can use it in other methods. But if I do this:</p>

<pre><code>class OpenBar
  @@clients = [@client1, @client2, @client3]

  def initialize
   #...
</code></pre>

<p>when I call the <code>winner_client</code> method it raises </p>

<pre><code>KatzBar.rb:57:in block in winner_client': undefined method drunk' for nil:NilClass (NoMethodError)
</code></pre>

<p>How can I fix this?</p>