Struggling to understand how an object can be created this way. What is happening behind the scenes here when constructing this object ?
class UserPreview < Struct.new(:gid, :email, :name)
end
u = UserPreview.new(1, 'hans@peter.de', 'Hans Peter')
=> #<struct UserPreview gid=1, email="hans@peter.de", name="Hans Peter">