Class: String

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

Instance Method Summary collapse

Instance Method Details

#lettersObject

Returns the letters in the string



13
14
15
# File 'lib/andjela_palindrome.rb', line 13

def letters
      self.chars.select { |c| c.match(/[a-z]/i) }.join
end

#palindrome?Boolean

Returns true for a palindrome, false otherwide.

Returns:

  • (Boolean)


8
9
10
# File 'lib/andjela_palindrome.rb', line 8

def palindrome?
  processed_content == processed_content.reverse
end