Great and you're welcome!

One more thing.
I forgot to pass the url of a gist created to benchmark the 3 approachs.

https://gist.github.com/abinoam/8898249

Abinoam Jr.

On Sun, Feb 9, 2014 at 9:38 AM, Arup Rakshit <lists / ruby-forum.com> wrote:
> Abinoam Jr. wrote in post #1136125:
>> Dear Arup,
>>
>> I don't know if the code bellow could read better in your opinion.
>>
>> But, from your first example you could pass "a" as an object on the
>> iteration.
>>
>> def del_first_three_refactored_2(a)
>>   num_to_del = a.find { |e| a.count(e) >= 3 }
>>   return a if num_to_del.nil?
>>   3.times.with_object(a) do |turn, obj|
>>     ind = obj.index { |e| e == num_to_del }
>>     obj.delete_at(ind)
>>   end
>> end
>>
>> Does it fit?
>
> This is good! Actually I forgot that `#times` give us `Enumerator`
> object.
>
> Thank you very much. It reads nice to me.
>
> --
> Posted via http://www.ruby-forum.com/.