module EwelPalindrome

Returns true for palindrome, false otherwise

Constants

VERSION

Public Instance Methods

palindrome?() click to toggle source
# File lib/ewel_palindrome.rb, line 5
def palindrome?
  if processed_content.empty?
    false
  else
  processed_content == processed_content.reverse
  end
end

Private Instance Methods

processed_content() click to toggle source
# File lib/ewel_palindrome.rb, line 15
def processed_content
  to_s.scan(/[a-z0-9]/i).join.downcase
end