Struct minangka kelas Ruby sing built-in kanggo nggawe kelas-kelas sederhana kanthi cepet sing bundel sawetara attributes — ngasilake konstruktor, accessors, equality, lan liyane kanthi otomatis. Iku cara sing ringkas kanggo nemtokake lightweight data classes tanpa nulis kelas lengkap.
Masalah sing Struct selesaikan
,
()
= x
= y
()
x == other.x && y == other.y
= .new(, )
