What is this syntax: &:day
Hello,
I've been using Ruby and Rails for about 4 months now and although not often, I've seen this syntax from time to time. What does it mean? For example, in Rails's latest blog post:
Code:
latest_transcripts.group_by(&:day).each do |day, transcripts|
p "#{day} -> #{transcripts.map(&:class) * ', '}"
end
"2006-03-01 -> Transcript"
"2006-02-28 -> Transcript"
"2006-02-27 -> Transcript, Transcript"
"2006-02-26 -> Transcript, Transcript"
See the &:day and &:class? What are these?