From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Sat, 26 Sep 2009 18:27:57 -0700 Subject: [sup-talk] Hook, again In-Reply-To: <1253988011-sup-8497@altis> References: <1253988011-sup-8497@altis> Message-ID: <1254014763-sup-4749@masanjin.net> Reformatted excerpts from Guillaume Quintard's message of 2009-09-26: > message.recipients.each { > |person| > if (person.email =~ /addr at site.com/) != nil > Person.from_address "Foo " > end > } The problem is that #each returns the original array, i.e. message.recipients. Your Person object is getting constructed and then forgotten. Try: if messages.recipients.any? { |p| p.email =~ /addr at site\.com/ } Person.from_address "Foo " end -- William