Similar questions | How does defining [bracket] methods work in ruby?