{id: classes}
{id: empty-class-definition} {i: class}
{id: class-with-attributes} {i: initialize} {i: @}
{id: class-with-getters}
{id: class-with-setters}
{id: class-with-getters-and-setters} {i: property} {i: getter}
{id: class-with-property-with-default-value} {i: property}
{id: class-with-declared-getter-and-default-value} {i: getter}
{id: class-with-declared-getter} {i: getter}
{id: class-serialization-to-from-json} {i: to_json} {i: from_json} {i: JSON::Serializable}
{id: compare-objects-for-equality}
Normally using ==
between two instances will only return true
if they are the exact same objects in the memory.
If "only" all the attributes are the same then ==
will be false
.
To be able to compare two objects based on their attributes only we can used the def_equals
macro.
{id: singleton-using-class-properties} {i: class_property}
{id: singleton-using-class-properties-with-defaults} {i: class_property}
{id: class-monkey-path-add-method}
{id: class-stringification} {i: to_s}