Should use << for string concatenation in Ruby

This commit is contained in:
Nathan Broadbent 2014-12-27 21:11:18 +06:00
parent da2b5e7506
commit 326e3cda59
1 changed files with 2 additions and 2 deletions

View File

@ -174,8 +174,8 @@ ERR
# Returns string
def date_to_html_string(date)
result = '<span class="month">' + date.strftime('%b').upcase + '</span> '
result += date.strftime('<span class="day">%d</span> ')
result += date.strftime('<span class="year">%Y</span> ')
result << date.strftime('<span class="day">%d</span> ')
result << date.strftime('<span class="year">%Y</span> ')
result
end