multiblocks is a by-and-large emulation of Smalltalk-like method calls which can take multiple parameters.

Here I provide a simple abstract, for examples see the rdoc documentation and the examples/ and test/ directories.

You can generate the rdoc documentation by makedoc.rb (don't just use a simple rdoc command by yourself, options do make a difference).

It is an extension of the class Module. (Among others) it defines Module#callgroup which can be used to define a group of methods, which behave like one in many aspects. Member methods of the callgroup collect their arguments upon each invocation, then the so-called sanitizer method is called, which can be used to transform arguments, check their type, order of the member method calls, and so on.

Finally the desired actions happen by calling the finalizer of the group (which can be added by Module#grp_finalizer), this is the method which does the actual job, using the collected arguments of all the performed member method calls. Resetting these arguments is ensured.

Features:

* thread safe
* can be used to implement keyword arguments with reflection
* provides a clean and simple way for structuring arguments of
complex method calls

Author: Csaba Henk, csaba-rubyATcreoDOThu

Homepage: www.creo.hu/~csaba/ruby/multiblocks

Copyright and License:

Copyright ? 2005 by Csaba Henk Released under the same terms of license as Ruby.