caesar_cipher_v2.rb
def caesar_cipher(str, num)
  alphabet = "abcdefghijklmnopqrstuvwxyz"
  converted = ""
  str.each_char { |char| converted += alphabet[(alphabet.index(char) + num) % 26] }
  converted
end
# Refactoring of 2nd time doing Open App Academy 17-09-2020
Refactoring of 2nd time doing Open App Academy 17-09-2020
Refactoring of 2nd time doing Open App Academy 17 - 09 - 2020
def caesar_cipher(str, num)
  alphabet = "abcdefghijklmnopqrstuvwxyz"
  converted = ""
  str.each_char { |char| converted += alphabet[(alphabet.index(char) + num) % 26] }
  converted
end
def caesar_cipher ( str , num ) alphabet = "abcdefghijklmnopqrstuvwxyz" converted = "" str . each_char { | char | converted += alphabet [ ( alphabet . index ( char ) + num ) % 26 ] } converted end
Refactoring of 2nd time doing Open App Academy 17-09-2020
Refactoring of 2nd time doing Open App Academy 17 - 09 - 2020
str
num