module ThwPalindrome

Constants

VERSION

Public Instance Methods

palindrome?() click to toggle source

Returns true for a palindrome, false otherwise.

# File lib/thw_palindrome.rb, line 6
def palindrome?
  if processed_content.empty?
    false
  else
    processed_content == processed_content.reverse
  end
end

Private Instance Methods

processed_content() click to toggle source

Returns content for palindrome testing.

# File lib/thw_palindrome.rb, line 21
def processed_content
  #scan(/[a-z]/i).join.downcase
  to_s.scan(/[a-z\d]/i).join.downcase
  #self.letters.downcase
end