module DnlPalindrome
module DnlPalindrome
class Error < StandardError; end # Your code goes here...
end
Constants
- VERSION
Public Instance Methods
letters()
click to toggle source
# File lib/dnl_palindrome.rb, line 14 def letters the_letters = Array.new for i in 0..self.length - 1 do if self[i].match(/[a-zA-Z]/) the_letters << self[i] end end the_letters.join end
palindrome?()
click to toggle source
# File lib/dnl_palindrome.rb, line 10 def palindrome? processed_content == processed_content.reverse end
Private Instance Methods
processed_content()
click to toggle source
# File lib/dnl_palindrome.rb, line 26 def processed_content self.to_s.downcase.letters end