Created
January 27, 2014 16:06
-
-
Save threeifbywhiskey/8651340 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Refinements | |
def self.included core | |
core.send :include, Refinements.const_get(core.to_s) | |
end | |
module String | |
def ^ other | |
chars.zip(other.chars.cycle).map { |a, b| (a.ord ^ b.ord).chr }.join | |
end | |
end | |
end | |
class String | |
include Refinements | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment