Part II of this series on Ruby class methods is a look at annotations in Ruby.
The term annotation here refers to a Ruby technique that belongs to the same family as Java annotations, C# attributes, and C compiler directives. These language features are of course not identical, and the class method derived Ruby version […]
Archive for October, 2007
Class Methods Part II - Annotations
« 26 October 2007 | 12:46 | patterns/idiom/style | 5 Comments »Class Methods
« 19 October 2007 | 11:34 | patterns/idiom/style, Smalltalk, Ruby Internals, MRI | 2 Comments »In my last post I wrote that providing a home for class methods was the raison d’être of the Metaclass. So why go through all the trouble? What are class methods good for? Four uses worth exploring are Object Creation, Annotations, DSL’s, and removal of structural duplication
This post is about Ruby class […]
Objects, Classes, and JRuby Internals
« 12 October 2007 | 8:56 | JRuby, Ruby Internals | 3 Comments »A walk through of the JRuby implementation wraps up this series on Ruby internals and Singleton classes.
JRuby is a Java implementation of the Ruby interpreter. That is to say, that one can write plain ol’ Ruby files and hand them off to the JRuby interpreter for execution in the same way that […]
The Metaclass
« 5 October 2007 | 9:34 | Ruby Internals, MRI | 5 Comments »If you search around the web a bit, you are sure to find the Ruby Metaclass defined as “The singleton class of a class.” While this definition is accurate, it doesn’t contribute to an understanding of why Metaclasses exist. It is also guilty of underplaying some notable difference between Metaclasses and “normal” Singleton […]