Module: Palindrome

Included in:
Integer, String
Defined in:
lib/dawidl022_palindrome.rb

Instance Method Summary collapse

Instance Method Details

#lettersObject


10
11
12
# File 'lib/dawidl022_palindrome.rb', line 10

def letters
  to_s.gsub(/[^\p{L}0-9]/, '')
end

#palindrome?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/dawidl022_palindrome.rb', line 6

def palindrome?
  processed_content == processed_content.reverse
end