P
Peter Fitzgibbons
Hello all,
I have this :
def mymethod
a =3D someobjectreference('a')
if a.nil?
return nil
end
b =3D a.someattribute_might_be_nil
if b.nil?
return nil
end
c =3D b.someattribute_might_be_nil
if c.nil?
return nil
end
c.dosomething
end
What is the ruby way to handle the if .nil? ladder created here?
Thanks.
Peter Fitzgibbons
I have this :
def mymethod
a =3D someobjectreference('a')
if a.nil?
return nil
end
b =3D a.someattribute_might_be_nil
if b.nil?
return nil
end
c =3D b.someattribute_might_be_nil
if c.nil?
return nil
end
c.dosomething
end
What is the ruby way to handle the if .nil? ladder created here?
Thanks.
Peter Fitzgibbons