I
Iain Barnett
$ irb
:clear, :collect, :collect!, :combination, :compact, :compact!, :concat, =
:count, :cycle, :delete, :delete_at, :delete_if, :detect, :drop, =
:drop_while, :each, :each_cons, :each_index, :each_slice, =
:each_with_index, :each_with_object, :empty?, :entries, :fetch, :fill, =
:find, :find_all, :find_index, :first, :flatten, :flatten!, :fold, =
:grep, :group_by, :include?, :index, :inject, :insert, :join, :last, =
:length, :map, :map!, :max, :max_by, :member?, :min, :min_by, :minmax, =
:minmax_by, :none?,
ne?,
ack,
artition,
ermutation,
op, =
roduct,
ush, :rassoc, :reduce, :reject, :reject!, :replace, =
:reverse, :reverse!, :reverse_each, :rindex, :sample, :select, :shift, =
:shuffle, :shuffle!, :size, :slice, :slice!, :sort, :sort!, :sort_by, =
:take, :take_while, :to_a, :to_ary, :transpose, :uniq, :uniq!, :unshift, =
:values_at, :zip, :]
This is extensions/Array.rb
class Array
=20
def index_in_range( n )
self.each_with_index do |x, i|
return i if x =3D=3D=3D n
end
return nil
end
=20
end
It *did* have a rand function in there, but I removed it because it was =
being loaded but the index_in_range wasn't. I've no idea how the rand =
function is still getting added if it's not defined in the file.
Any help is more than appreciated, it's needed for my continued sanity =
(which was already at question)
Regards,
Iain
=3D> [:, :, :, :-, :, :=3D>, :[], :[], :all?, :any?, :assoc, :at, =r =3D [1..99, 100..199] =3D> [1..99, 100..199]
xs =3D r.local_methods=20
:clear, :collect, :collect!, :combination, :compact, :compact!, :concat, =
:count, :cycle, :delete, :delete_at, :delete_if, :detect, :drop, =
:drop_while, :each, :each_cons, :each_index, :each_slice, =
:each_with_index, :each_with_object, :empty?, :entries, :fetch, :fill, =
:find, :find_all, :find_index, :first, :flatten, :flatten!, :fold, =
:grep, :group_by, :include?, :index, :inject, :insert, :join, :last, =
:length, :map, :map!, :max, :max_by, :member?, :min, :min_by, :minmax, =
:minmax_by, :none?,
:reverse, :reverse!, :reverse_each, :rindex, :sample, :select, :shift, =
:shuffle, :shuffle!, :size, :slice, :slice!, :sort, :sort!, :sort_by, =
:take, :take_while, :to_a, :to_ary, :transpose, :uniq, :uniq!, :unshift, =
:values_at, :zip, :]
=3D> [:rand]load 'extensions/Array.rb' =3D> true
r.local_methods - xs
This is extensions/Array.rb
class Array
=20
def index_in_range( n )
self.each_with_index do |x, i|
return i if x =3D=3D=3D n
end
return nil
end
=20
end
It *did* have a rand function in there, but I removed it because it was =
being loaded but the index_in_range wasn't. I've no idea how the rand =
function is still getting added if it's not defined in the file.
Any help is more than appreciated, it's needed for my continued sanity =
(which was already at question)
Regards,
Iain