Skip to content

Instantly share code, notes, and snippets.

@h3h
Created September 12, 2011 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3h/1210669 to your computer and use it in GitHub Desktop.
Save h3h/1210669 to your computer and use it in GitHub Desktop.
Ruby Array Enumerator Return Values
>> class MyArray < Array; end
=> nil
>> a = MyArray.new([1,2,3])
=> [1, 2, 3]
>> a.class
=> MyArray
>> a.reject {|x| x > 2}.class
=> MyArray
>> a.select {|x| x > 2}.class
=> Array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment