Eliminating astonishment with a special Ruby idiom for object creation.
Tag: operators

Episode #391: Hash Subset
A new feature in Ruby 2.3 makes it easier to compare hashes by value.

Episode #266: Pattern Matching
Ever wanted to have fancy pattern-matching in Ruby like that found in languages like Erlang or Elixir? Well, today we'll construct the ability to do just that!

Episode #223: Equalizer
We know that Value Objects are useful; today we'll meet a gem that makes them easier to build.

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 #202: Identity And Equality
Today's episode deals with the concepts of identity and equality - what makes one object equal to another.

Episode #159: Array Set Operations
Sometimes we'd like to treat Ruby arrays like sets, in which each item is unique. Today's dish shows how!

Episode #125: And/Or
Ruby has both symbolic and English forms of the logical "and" and "or" operators. Which one to choose may seem like a matter of taste, but that assumption can get …

Episode #043: Exclusive Or
This episode looks at Ruby's logical XOR operator, and how it can be useful in checking that a method was called with the correct optional arguments.

Episode #037: Proc and Threequals
Today's dish combines the great flavor of Ruby's 'case' statement with a little Proc seasoning and a threequals demiglace!