Write a method def caesar_cipher(string, number) that takes a string and a number as an argument and returns a string based on the following requirements:
-
Shift each letter in the string
numberspots down the alphabet. For example, runningcaesar_cipher("a", 2)would return"c".caesar_cipher("z", 2)would return"b".caesar_cipher("Caesar", 2)would return"Ecguct". -
Punctuation, capitlization and spacing should be unchanged. Numbers also remain unchanged.
Notes:
- Do the assignment with TDD if you want some TDD practice (you likely will need another file in addition to
code.rbfor your test suite if you choose to do this)!