Skip to content

Instantly share code, notes, and snippets.

@threeifbywhiskey
Created January 27, 2014 16:06
Show Gist options
  • Save threeifbywhiskey/8651340 to your computer and use it in GitHub Desktop.
Save threeifbywhiskey/8651340 to your computer and use it in GitHub Desktop.
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