Skip to content

Instantly share code, notes, and snippets.

@aikyo02
Created August 5, 2014 11:20
Show Gist options
  • Save aikyo02/4551bfe44a5a4c53056c to your computer and use it in GitHub Desktop.
Save aikyo02/4551bfe44a5a4c53056c to your computer and use it in GitHub Desktop.
refactor
require "cipher_word/version"
module CipherWord
def self.cipher(word)
cipher = ''
word.each_codepoint do |code|
code += 1
cipher += code.chr
end
cipher
end
def self.decoding(word)
decoding = ''
word.each_codepoint do |code|
code -= 1
decoding += code.chr
end
decoding
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment