2019 Archives

ValueSemantics—A Gem for Making Value Classes

— Tags: Ruby Pigeon, Ruby

Today I am announcing ValueSemantics — a gem for making value classes. This is something that I’ve been using in my personal projects for a while, and I think it’s now ready for public use as of v3.0.

In this article, I will give an overview of the gem, but I mainly want to talk about the thought process behind designing a library. We’ll look at:

  • features
  • design goals
  • comparisons to similar gems
  • the module builder pattern
  • case equality
  • callable objects
  • opinions about freezing
  • Integration Continuity™
  • designing DSLs
  • stability in cross-cutting concerns