About
Hi! I'm Avdi Grimm, and this is my software development blog. More...
Books and Screencasts
Objects on Rails
A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.
-
Subscribe
-
Recent Posts
Archives
Categories
Meta
Tag Archives: arrays
Array Set Operations in Ruby
Sometimes you want to treat an Array like a set. Continue reading
Treating Arrays as Sets
Reading through the Rake source code the other day (a pastime I highly recommend), I was reminded of a technique I don’t use often enough: my_array = [:foo, :bar, :baz] my_array |= [:baz, :buz] # => [:foo, :bar, :baz, :buz] … Continue reading




