title: Rack-Attack: Array of IP addresses
body: <p>I'm trying to create an array of IP addresses so that when the application is ran Rack-Attack can identify from the set of IP addresses that are allowed to access the application. So what I have done is as followed: </p>
  
  <pre><code>  a = "127.0.0.1"
    Rack::Attack.blacklist('allow from localhost') do |req|
      p "#{'127.0.0.1' == req.ip} "
     a != req.ip 
    end
  </code></pre>
  
  <p>The above works, so localhost can access the application but I have tried the following below which seems to not work what so ever:</p>
  
  <pre><code>a = "127.0.0.1", "1.2.3.4"
    Rack::Attack.blacklist('allow from localhost') do |req|
      a.select{|x| x != req.ip}.join("")
    end
  </code></pre>
  
  <p>Can someone explain what the correct way would be to do this. You can see that I create an array. I want <code>Rack::Attack</code> to detect whether the IP address in the array has access or not. </p>