Module: DnlPalindrome
Overview
module DnlPalindrome
class Error < StandardError; end
# Your code goes here...
end
Constant Summary collapse
- VERSION =
"0.1.25"
Instance Method Summary collapse
Instance Method Details
#letters ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# 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? ⇒ Boolean
10 11 12 |
# File 'lib/dnl_palindrome.rb', line 10 def palindrome? processed_content == processed_content.reverse end |