In the section 3.8.2 (Object lifetime) of The Ruby Programming Language book, it says:
The built-in Ruby classes described in this chapter have literal syntaxes, and instances of these classes are
created simply by including their values literally in your code. Objects of other classes need to be explicitly
created, and this is most often done with a method named new:
myObject = myClass.new
created simply by including their values literally in your code. Objects of other classes need to be explicitly
created, and this is most often done with a method named new:
myObject = myClass.new
This is wrong cos there can never be a class of name “myClass” cos “class/module name must be CONSTANT“.
Blogged with the Flock Browser
Advertisement