From: Matthew Kerwin Date: 2013-03-11T13:27:15+09:00 Subject: Re: Question regarding automating some Outlook/IMAP and pdf parsing functions w/ ruby? Joel Pearson wrote in post #1100986: > Can't do a single line rescue with a specific class... > > if ( > begin > msg.Senderemailaddress =~ /@exampledomain.com$/i > rescue NoMethodError > false > end > ) && Oh, thanks for reminding me! Many years ago I made a thing which I thought could be potentially useful. Recently I even modified it to fit with my more mature understanding of Ruby. Inspired by this message, I've just gemified it. https://rubygems.org/gems/try require 'try' if (Try.trap(NoMethodError=>false){msg.Senderemailaddress =~ /@exampledomain.com$/i} && -- Posted via http://www.ruby-forum.com/.