require "julbosch_palindrome/version" module JulboschPalindrome # Returns true for a palindrome, false otherwise. Also false for empty strings. def palindrome? if processed_content == "" return false else return processed_content == processed_content.reverse end end private # Returns content for palindrome testing. def processed_content return self.to_s.scan(/[a-z0-9]/i).join.downcase end end class String include JulboschPalindrome end class Integer include JulboschPalindrome end