I was wondering if anyone could explain to me what the
? w : w.capitalize
block means in:
def titlieze(title)
stop_words = %w(and in the of a an)
title.capitalize.split.map{|w| stop_words.include?(w) ? w : w.capitalize}.join(' ')
end
Any help is very much appreciated... Thank you in advance.