if @person && @person.name
Object#try is a Rails addition and not available in pure Ruby. Maybe update the tags to reflect that. If you want something similar in Ruby, there's a gem called "andand".
@citizen428 Of course, I'm inconsiderate ...