require "dhoard_palindrome/version" class String # Returns true for a palindrome, false otherwise. def palindrome? processed_content == processed_content.reverse end # Returns the letters in a string def letters letter_regex = /[a-zA-Z]/ self.chars.select { |c| c.match(letter_regex)}.join end private # Returns content for palindrome testing. def processed_content scan(/[a-z]/i).join.downcase end end