Class: Array
Instance Method Summary collapse
Instance Method Details
#index(*args, &block) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/core_ext/array.rb', line 3 def index(*args, &block) if block_given? each_with_index { |v,i| return i if yield(v) } return nil else old_index(*args) end end |
#old_index ⇒ Object
2 |
# File 'lib/core_ext/array.rb', line 2 alias :old_index :index |
#symbolize ⇒ Object
12 |
# File 'lib/core_ext/symbolize.rb', line 12 def symbolize; map { |e| e.symbolize }; end |