From: Thorsten Rossner Date: 2007-06-22T18:53:53+09:00 Subject: avoiding nil.methodcalls short and cheap Hi, I often have to check if a methodcall A is not returning nil before calling another method on the return value of the methodcall A. I'm looking for a short and cheap (avoiding to call method A two times like in this example where xmltag.get_text is method A: textvalue = xmltag.get_text.value if xmltag.get_text ) The ideal solution would be a oneliner with only little complexity calling method A just one time. Am I using the wrong approach here anyway? Thanks, .tr! -- Posted via http://www.ruby-forum.com/.