Groovy:
if there`s my_object -> access \'name\' and capitalize
my_object?.name?.capitalize()
What is the equivalent for ruby to avo
Assuming you mean you want to avoid a nil error if my_object is nil. Try :
my_object?.name?.capitalize() unless my_object.nil?
Ruby will do the nil check first and only then try to access the attribute if my_object isn't a null.
Dave