i want new Enumerable Methods, "includes, anies"

#includes
##before:
enum.each do |e|
  if e == "1"
    #bla~
    #bla~
  end
end

##after:
enum.includes("1"). do
  #bla~
  #bla~
end

#anies
##before:
enum.each do |e|
  if e.id == "1"
    #bla~
    #bla~
  end
end

##after:
enum.anies(id == "1"). do
  #bla~
  #bla~
end

my eng is very poor.
so i'm afraid wrong-understand

#includes
##before:
enum.each do |e|
if e == "1"
#bla~
#bla~
end
end

##after:
enum.includes("1"). do
#bla~
#bla~
end

You can also do this with:

enum.select { |e| e == "1" }.each do ...

so your 'includes' function could be written as:

class Enumerable
  def includes(o, &block)
    select { |e| e == o }.each(&block)
  end
end

#anies
##before:
enum.each do |e|
if e.id == "1"
#bla~
#bla~
end
end

##after:
enum.anies(id == "1"). do
#bla~
#bla~
end

I don't think this will even parse - passing bare code fragments like
that doesn't work in Ruby.

--Matt Jones