From: David Masover Date: 2009-04-06T00:44:48+09:00 Subject: Re: Function as Parameter? On Saturday 04 April 2009 14:02:45 Tomas Na wrote: > I am new to Ruby so I don't know a great deal about the language, but > what I am trying to do is the following: [snip] > To make this happen I figured I would pass in a callback. Searching > around, I couldn't find a lot of info about callbacks, Search for blocks. Your example would probably be written something like this: LoginForm.new(xaApp,'TestApp') do |arg1, arg2| callback logic goes here end You may end up just calling a function inside that block, and that's fine. But the idiomatic way is likely to provide a block. If you need to pass more than one such "callback", you can pass proc objects, but that's often slower and definitely more annoying for whoever uses that class.