E
Eric-Roger Bruecklmeier
Hi rubyists,
i try so solve the following problem:
class Foo
def initialize(par)
if par 'not good'
return nil <= ???
else
do something usefull
end
end
The goal is to create an instance of NilClass instead of Foo if par has
certain attributes:
test = Foo.new(good)
p test.class -> Foo
test = Foo.new(bad)
p test.class -> NilClass
Any suggestions how this can be done?
Thanx!
Eric.
i try so solve the following problem:
class Foo
def initialize(par)
if par 'not good'
return nil <= ???
else
do something usefull
end
end
The goal is to create an instance of NilClass instead of Foo if par has
certain attributes:
test = Foo.new(good)
p test.class -> Foo
test = Foo.new(bad)
p test.class -> NilClass
Any suggestions how this can be done?
Thanx!
Eric.