Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/andrewau_palindrome.rb

Instance Method Summary collapse

Instance Method Details

#lettersObject



11
12
13
# File 'lib/andrewau_palindrome.rb', line 11

def letters
  self.gsub(/\W+/, '')
end

#palindrome?Boolean

Returns true for a palindrome, false otherwise.

Returns:

  • (Boolean)


7
8
9
# File 'lib/andrewau_palindrome.rb', line 7

def palindrome?
  processed_content == processed_content.reverse
end