lib/jkoo_palindrome.rb in jkoo_palindrome-0.1.0 vs lib/jkoo_palindrome.rb in jkoo_palindrome-0.2.0
- old
+ new
@@ -1,13 +1,22 @@
require "jkoo_palindrome/version"
-class String
+module JkooPalindrome
def palindrome?
processed_content == processed_content.reverse
end
private
def processed_content
- self.scan(/[a-z]/i).join.downcase
+ self.to_s.scan(/[a-z\d]/i).join.downcase
end
+end
+
+
+class String
+ include JkooPalindrome
+end
+
+class Integer
+ include JkooPalindrome
end