Path: | lib/extensions/_base.rb |
Last Update: | Sun Jul 18 11:32:36 +0000 2004 |
This file is ‘required’ by all files that implement standard class extensions as part of the "Ruby/Extensions" project.
The "Extensions" project requires 1.8.0 or greater to run, as it is too much hassle at the moment to consider supporting older versions. That may one day be implemented if demand is there. One option would be to require "shim", so that we can assume all 1.8 library methods are implemented.
This file is only of interest to developers of the package, so no detailed documentation is included here. However, by way of introduction, this is what it‘s all about. Each method that is implemented as part of this package is done so through a framework implemented in this file. Take the following simple example:
ExtensionsProject.implement(Integer, :even?, :instance) do class Integer # # RDoc comments. # def even? self % 2 == 0 end end end
This purposes of this are as follows:
The ExtensionsProject.implement method is responsible for ensuring these are so. It gives us documentation, and some assurance that the extensions are doing what we say they are doing.