From: Adam Shelly Date: 2008-08-09T05:07:58+09:00 Subject: Re: Works in irb but not elsewhere On 8/8/08, cardboard42@gmail.com wrote: > On Aug 8, 3:26 pm, Patrick Li wrote: > > Hi i'm creating a DSL, and would like to use the following > > functionality.It works fine in irb but when I run it from the > > commandline. Does it look like my fault or a ruby bug? > > > > class A > > def method > > puts "a" > > end > > def A.create > > A.new.instance_eval { yield } > > end > > end > > > > A.create{method} I think the issue is in the last line: you are calling Object#method', which expects one parameter. You ought to be using the String "method" to send to instance_eval. -Adam