lib/core/facets/array/index.rb in facets-2.8.4 vs lib/core/facets/array/index.rb in facets-2.9.0.pre.1
- old
+ new
@@ -1,17 +1,15 @@
class Array
- # CORE OVERRIDE
-
if RUBY_VERSION < '1.8.7'
alias_method :_facets_index, :index
# Allows #index to accept a block.
#
- # OVERRIDE! This is one of the bery few core
- # overrides in Facets.
+ # ['a', 'b', 'c'].index{ |x| x.upcase == 'C' } #=> 2
#
+ # IMPORTANT: This is one of the few core overrides in Facets.
def index(obj=nil, &block)
if block_given?
_facets_index(find(&block))
else
_facets_index(obj)