Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/andrewau_palindrome.rb
Instance Method Summary collapse
- #letters ⇒ Object
-
#palindrome? ⇒ Boolean
Returns true for a palindrome, false otherwise.
Instance Method Details
#letters ⇒ Object
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.
7 8 9 |
# File 'lib/andrewau_palindrome.rb', line 7 def palindrome? processed_content == processed_content.reverse end |