From: luke gruber Date: 2011-10-18T08:20:38+09:00 Subject: Re: How to use a method inside a block Hey, Try putting the method definition before the block: > def mult(x,y) > x*y > end > (1..5).each do |n| > mult(n,2) > end This should work, I'm pretty sure. It has to do with the way Ruby treats methods/variables that are first defined/invoked in a block. Since blocks open up a new scope (even if it's just a nested scope encompassing the previous), anything the parser sees that's first referenced in a block and isn't defined will throw an error. That's my understanding, anyway. -Luke -- Posted via http://www.ruby-forum.com/.