問題
1&.to_hoge #=> ?
答え
1&.to_hoge #=> NoMethodError: undefined method `to_hoge' for 1:Fixnum
ちょっと解説
# 存在しないメソッドを呼ぶ場合、
# tryだとnilになるが、
# &.だとNoMethodErrorになる。
1.try(:to_hoge) #=> nil
1&.to_hoge #=> NoMethodError: undefined method `to_hoge' for 1:Fixnum
#ちなみに、レシーバがnilだったら、どっちでもnilになる。
nil.try(:to_hoge) #=> nil
nil&.to_hoge #=> nil