We need a special method for most of the cases to avoid + undefined on Nil.
Based on the type of the internal object, It should return its default value.
For Ex:
1. String - empty string or ""
name = nil
(name.new_method) should return empty
when i use for concatenating name with any other variable, I can avoid throwing exception.
2. Integer: 0
3. float: 0.0
so on..
this really helps avoiding lot of job failures due to Nil, like + is undefined on nil class.
Send us a ticket, we will try our best to assist you with your problem
Saul Macht
Provide a method for similar to presence, If present should return value otherwise empty (but not nil)
We need a special method for most of the cases to avoid + undefined on Nil.
Based on the type of the internal object, It should return its default value.
For Ex:
1. String - empty string or ""
name = nil
(name.new_method) should return empty
when i use for concatenating name with any other variable, I can avoid throwing exception.
2. Integer: 0
3. float: 0.0
so on..
this really helps avoiding lot of job failures due to Nil, like + is undefined on nil class.