From: Eric Christopherson Date: 2011-10-18T08:17:31+09:00 Subject: Re: How to use a method inside a block On Mon, Oct 17, 2011 at 6:10 PM, Eqbal Quran wrote: > Hi everyone , > > Was wondering, how am I supposed to use a method inside a block , as for > example , how am I supposed to use mult function in the flowing block : > > (1..5).each do |n| >  mult(n,2) > end > > def mult(x,y) >  x*y > end > > I keep getting undefined method ‘mult’ for main:Object , while self for > both inside the block and outside it is main mult needs to be defined before it's used.