Ruby generally doesn't allow mixing of types without explicit conversion. So have you ever wondered why it's possible to multiply 2.3 (a float) by 5 (an integer)? In today's episode we'll discover how Ruby's implicit coercions work, and how to apply them to our own custom numeric-like classes.
Oop, this content isn't available to visitors. Please register or
log in to continue!
Or you could purchase this course.
Responses