Shopify / measured

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

Add #scale method for multiplying by a scalar #57

Closed thegedge closed 7 years ago

thegedge commented 7 years ago

From https://github.com/Shopify/measured/issues/46#issuecomment-264977606 and onwards, we want to get rid of multiplication / division on Measurable instances because, for example, 1kg · 1kg = 1kg². The new way to scale the value of a Measurable is via its #scale method.

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

thegedge commented 7 years ago

Oh yeah, I keep forgetting that. Good catch. Updated!