From: Yossef Mendelssohn Date: 2008-11-28T05:38:47+09:00 Subject: private #initialize My apologies if this has been discussed before, but I couldn't find anything in a Google search, searching this particular list/group on Google, or my first attempt at blade. (Later attempts complained about not being able to access the index.) So, in Ruby a private method is one that can only be called by the object itself, and that's enforced by the simple rule of disallowing an explicit receiver. Of course, there are ways around this; any message can be passed if you just know what to do. Maybe I'm late to the game, but I didn't realize it was okay to have #initialize be a private method. More than that, I didn't realize #initialize was *always* private. This confuses me because I think of SomeClass.new to be def new(*args, &block) instance = allocate instance.initialize(*args, &block) instance end But that obviously can't be the case if #initialize is private. Instead, it has to be def new(*args, &block) instance = allocate instance.send(:initialize, *args, &block) instance end It's a small change, but significant. And it seems odd to have something this central to the language skirting the boundaries of access control. Is it simply because an object shouldn't be re- initialized once it's created? And if so, is that so horrible? -- -yossef