module Jtellis1991Palindrome
Constants
- VERSION
Public Instance Methods
palindrome?()
click to toggle source
Returns true for a palindrome, false otherwise.
# File lib/jtellis1991_palindrome.rb, line 5 def palindrome? processed_content == processed_content.reverse end
Private Instance Methods
processed_content()
click to toggle source
Returns content for palindrome testing.
# File lib/jtellis1991_palindrome.rb, line 12 def processed_content self.to_s.scan(/[a-z\d]/i).join.downcase end