Skip to content

Instantly share code, notes, and snippets.

@snowblink
snowblink / gist:47900
Created January 16, 2009 11:29 — forked from joho/gist:47746
# what is the idiomatic ruby for this:
# if the var is an array, do_something with each element, otherwise just do something with the var
# if var.is_a?(Array)
# var.each do |element|
# do_something(element)
# end
# else
# do_something(var)
# end