Learn how to create value objects in Ruby using idiomatic practices with the Data class. This post covers the properties of value objects, their advantages over basic structures like Hashes, and how to define, instantiate, and customize Data objects in Ruby, while maintaining immutability and comparability.

10m read timeFrom allaboutcoding.ghinda.com
Post cover image
Table of contents
Permalink What is a value-alike object?Permalink Why use a value object?Permalink The Idiomatic Ruby way since 2022Permalink Data class vs StructPermalink A bit on the immutabilityPermalink Some conclusions

Sort: