T
trans. (T. Onoma)
Tiny RCR suggestion:
Array#index optionally take a block like Enumerable#detect does.
['a','b','c'].index{|e| e == 'b'} # => 1
['a','b','c'].index{|e| e == 'c'} # => 2
['a','a','a'].index{|e| e == 'a'} # => 0
['a','a','a'].index{|e| e == 'b'} # => nil
Question: why isn't #index a method of Enumerable, considering
#each_with_index is? (FYI: 'alias find detect'.)
Lastly, what about an rdetect?
--
( o _ カラム(Pakistan)
// trans.
/ \ (e-mail address removed)
I don't give a damn for a man that can only spell a word one way.
-Mark Twain
Array#index optionally take a block like Enumerable#detect does.
['a','b','c'].index{|e| e == 'b'} # => 1
['a','b','c'].index{|e| e == 'c'} # => 2
['a','a','a'].index{|e| e == 'a'} # => 0
['a','a','a'].index{|e| e == 'b'} # => nil
Question: why isn't #index a method of Enumerable, considering
#each_with_index is? (FYI: 'alias find detect'.)
Lastly, what about an rdetect?
--
( o _ カラム(Pakistan)
// trans.
/ \ (e-mail address removed)
I don't give a damn for a man that can only spell a word one way.
-Mark Twain