Numeric operations on value objects in Ruby
Here’s a little Ruby puzzle. Imagine you have a Value class that wraps a number, and implements numeric operations. How would you go about implementing the class in a way that lets you do something like 2 + Value.new(3) and returns Value.new(5)?
Read on to find out: Numeric operations on value objects in Ruby
Post a comment