Numeric operations on value objects in Ruby #214
nithinbekal
started this conversation in
Submissions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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)?
https://nithinbekal.com/posts/numeric-operations-value-objects/
Beta Was this translation helpful? Give feedback.
All reactions