may i know what is the different between Door::new and Door.new i seem to work the same.
on 2007-04-08 07:55
on 2007-04-08 13:25
The :: operator and the . operator only behave differently when constants are involved AFAIK. Foo::Bar will only look for the constant and raise an exception otherwise. Foo::Bar() and Foo::Bar X will only look for a method. Foo.Bar will only look for a method. Otherwise the :: operator is equivalent to the . operator, even for non-module/class objects: 5::to_s # => "5" 5::+ 6 # => 11