Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.