Guest User

Untitled

a guest
Jan 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. >> class MyArray < Array; end
  2. => nil
  3.  
  4. >> a = MyArray.new([1,2,3])
  5. => [1, 2, 3]
  6.  
  7. >> a.class
  8. => MyArray
  9.  
  10. >> a.reject {|x| x > 2}.class
  11. => MyArray
  12.  
  13. >> a.select {|x| x > 2}.class
  14. => Array
Add Comment
Please, Sign In to add comment