I have found very rare(to me) line of code in one of ours old repositories. Following code aws part of PoC application for simple Note taking app. Nevertheless, these two lines in model folder surprised me:
class Note < Struct.new(:title, :due_to, :body, :self_url, :image_url)
end
I was looking up this technique for a while and haven't really found some valuable source of information about this implementaiton.
Can someone help me to better understand this? I think that this kind usage of Struct just creating new object which inherits from Struct. But I don't see the benefits here.