Skip to content

Instantly share code, notes, and snippets.

@ono
Created January 15, 2010 11:47
Show Gist options
  • Save ono/277990 to your computer and use it in GitHub Desktop.
Save ono/277990 to your computer and use it in GitHub Desktop.
a = lambda {|src| src.map { |v| v.is_a?(Fixnum) ? v + 1 : v.is_a?(Array) ? a.call(v) : v } }
a.call [1, 2, 3, ["a", 1, 2, 3, ["a", 1, 2, 3], "a"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment