On 2010-10-10, at 17:24 , Laurent Sansonetti wrote:
>
> Indeed, +initialize won't be called for pure-Ruby classes. I recommend to use
> the Ruby idiom here, it's simpler :)
So, the problem I'm seeing is what I alluded to earlier: writing stuff in the
class body is more like +load than +initiali
Hi Caio,
On Oct 10, 2010, at 9:35 AM, Caio Chassot wrote:
> Hi,
>
> It looks like self.initialize is a no-go:
>
>class Foo
> def self.initialize
>NSLog("self.initialize is a sd panda") # <- never runs
> end
>end
>
>
> The ruby idiom for that would be just:
>
>
On 2010-10-10, at 15:15 , Matt Aimonetti wrote:
>
> The problem in your example is that in Ruby, the constructor is an instance
> method, not a class method.
> So your mistake was to define self.initialize instead of just initialize.
I'm afraid you misunderstood my question.
I'm not talking abou
$ macruby -e "class Foo; def initialize; puts '10/10/10'; end; end;
Foo.new"
10/10/10
The problem in your example is that in Ruby, the constructor is an instance
method, not a class method.
So your mistake was to define self.initialize instead of just initialize.
class Foo
def initialize
Hi,
It looks like self.initialize is a no-go:
class Foo
def self.initialize
NSLog("self.initialize is a sd panda") # <- never runs
end
end
The ruby idiom for that would be just:
class Foo
NSLog("IM IN UR CLASS INITIALIZEEN FROM RUBY")
end
is that