You are here |
blog.jetbrains.com | ||
| | | |
www.blackbytes.info
|
|
| | | | Ruby 2.4 is coming! What are some of the new features available in this version? Read this post to find out :) | |
| | | |
www.destroyallsoftware.com
|
|
| | | | ||
| | | |
grosser.it
|
|
| | | | Diff is defined on Set, but not on Array, so we patch it in... (thanks to reto) Usage [1,2] ^ [2,3,4] == [1,3,4] Code class Array def ^(other) result = dup other.each{|e| result.include?(e) ? result.delete(e) : result.push(e) } result end unless method_defined?(:^) alias diff ^ unless method_defined?(:diff) end puts ([] ^ [1]).inspect # [1] puts... | |
| | | |
stribny.name
|
|
| |