Where do we draw the line between objects differntiated only by state, and objects differentiated by their class? That's the question we'll examine in this episode.
Tag: data
Episode #219: Adamantium
Today we learn about Ruby gem that makes it easier to build immutable value objects.
Episode #218: Spaceship Revisited
In episode 205 we introduced the spaceship () operator, but we also introduced an incompatibility with how Ruby's builtin comparisons work. Today we'll address this oversight.
Episode #210: Implicit Conversion
Have you ever wondered why Ruby has both #to_i and #to_int methods? Or both #to_a and #to_ary? In today's episode we'll answer this question, and look at how we can …
Episode #208: Lenient Conversions
For core types like Float, Ruby has both conversion methods (#to_f), and conversion functions (Float()). When should we use one vs. the other? This episode attempts to answer that question.
Episode #206: Coercion
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 …
Episode #205: Comparable
In this episode we meet a Ruby standard module that makes it easy to make classes comparable and sortable.
Episode #204: Hash Equality
Building on the previous episode on hash tables, today we tackle the concept of hash equality: how Ruby decides if two objects are the same for the purpose of use …
Episode #202: Identity And Equality
Today's episode deals with the concepts of identity and equality - what makes one object equal to another.