I
Iain Barnett
I've found that whenever I have a variable that may be nil, doing
.to_i or .to_s or .to_a or something similar (so long as the NilClass
supports the type conversion I need) can come in handy.
So for something like:
big_array = array_or_nil_var1 + array_or_nil_var2 + array_or_nil_var3
I would just do:
big_array = array_or_nil_var1.to_a + array_or_nil_var2.to_a +
array_or_nil_var3.to_a
Aaron out.
Nice tip, thanks!
Regards,
Iain