Skip to content

Instantly share code, notes, and snippets.

@dominicpacquing
Created June 6, 2012 04:41
Show Gist options
  • Save dominicpacquing/2879953 to your computer and use it in GitHub Desktop.
Save dominicpacquing/2879953 to your computer and use it in GitHub Desktop.
Array identify new content
Array.class_eval do
def xy(arr2)
arr1 = self.dup
arr1, arr2 = arr2, arr1 if (arr1 <=> arr2) == 1
(arr1 + arr2) - (arr1)
end
end
@wnuqui
Copy link

wnuqui commented Jun 6, 2012

from irb to gist! haha

@dominicpacquing
Copy link
Author

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment