Classes/Modules ALLBASECOMMON
sLoPpYHTMLbIaTcH
|
Mega Modules
Ruby's Massive Class Collection Mega Modules is an open-source collection of classes and modules for the Ruby programming language. The goal of the project is to offer a large set of high-quality general purpose "parts" that target the needs of a variety of potential applications. Mega Modules is sister to the Nano Methods project. They both have this great slogan, "ALL BASE COMMON". The notion is that the more we share in the way of a common foundation, the better that foundation can serve us. There are a number of advantages to this approach.
Initially our focus has been on general language-oriented components. The next phase will begin to incorporate more specific real world cases. Please see the API documentation to learn more about each of class or module. Spotlight: EnumerableArgs
Has it ever occured to you that you can't define an #each method which takes parameters and have it work with the Enumerable mixin? It's true. Try it and you'll get an ArgumentError. Enumerable's methods just weren't designed to pass through any parameters to #each. Well, if you've never thought about it before, I suppose it's never been a bother. But if you're one of the unlucky few who has actually tried to do so, probably not thinking muuh of it, you know just how frustrating it is. You are reduced to writing your own #find, #map, #select and the many other normally eager-to-mix methods of Enumerable. Fret no longer! EnumerableArgs is here. Simply include it into your class and it will take care of the rest. It's quite nearly 100% compatible to Enumerable in every way. So you shoudn't miss a beat. Why not give it a try? Before long you'll be joining me doing fun things like:
def each( kind=nil )
case kind
when :key, odd
# ...
when :value, :even
# ...
else
end
Those associative arrays don't stand a chance. Legaliese
Mega Modules, Copyright (c) 2005 Thomas Sawyer Mega Modules is provided under the Ruby License.
Credit and Copyrights for particular borrowed code segments are given in their respective source. All licenses are either compatible with the Ruby lincense or the original author has given permission for inclusion of their code under this lincense. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |