Builder

Builder: assemble a complex object step by step

Problem: an object has many optional parts, and stuffing them all into one constructor is unreadable.

PawWalk scenario: a booking search query with filters, a sort, and a page. You want to add pieces fluently and then produce a plain hash to run.

The Ruby realization: chainable methods that each mutate state and return self, plus a final build that hands back the assembled hash.