title: How to refer the index of an element in Array#delete_if
body: <p>I want to build a custom method <code>Array#drop_every(n)</code> (I know it's monkey patching, I am doing this for a homework), which returns a new array omitting every nth element:</p>
  
  <pre><code>[4, 8, 15, 16, 23, 42].drop_every(2) # [4, 15, 23]
  </code></pre>
  
  <p>I want to implement it with <code>Array#delete_if</code>, but by referring to the index and not to the element itself, (similar to <code>each_index</code>) something like this:</p>
  
  <pre><code>def drop_every(step)
    self.delete_if { |index| index % step == 0 }
  end
  </code></pre>
  
  <p>How do I do this? I don't insist on using <code>delete_if</code>, I also looked at <code>drop_while</code> and <code>reject</code>, other suggestions are welcome.</p>