Module: BmbcPalindrome
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
-
#palindrome? ⇒ Boolean
Returns true for a palindrome, false otherwise.
-
#processed_content ⇒ Object
Returns content for palindrome testing.
Instance Method Details
#palindrome? ⇒ Boolean
Returns true for a palindrome, false otherwise.
5 6 7 |
# File 'lib/bmbc_palindrome.rb', line 5 def palindrome? processed_content == processed_content.reverse end |
#processed_content ⇒ Object
Returns content for palindrome testing.
10 11 12 |
# File 'lib/bmbc_palindrome.rb', line 10 def processed_content self.to_s.scan(/[a-z\d]/i).join.downcase end |