Shopify / measured

Encapsulate measurements and their units in Ruby and Ruby on Rails.
MIT License
337 stars 28 forks source link

Make Conversion immutable through a builder pattern #48

Closed thegedge closed 7 years ago

thegedge commented 7 years ago

Closes https://github.com/Shopify/measured/issues/47

Making Conversion immutable makes it much easier to do various performance optimizations (e.g., managing the unit name mapping in https://github.com/Shopify/measured/pull/29 becomes a one time operation) and again, as always, makes code easier to understand.

@kmcphillips @benwah

thegedge commented 7 years ago

Awesome review, @kmcphillips and @benwah. PTAL, as I should have addressed all points.

thegedge commented 7 years ago

Added a better exception message for when you do things wrong with Measurable