Module: BrowngwPalindrome
- Defined in:
- lib/browngw_palindrome.rb,
lib/browngw_palindrome/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
-
#letters ⇒ Object
Returns the letters in the string.
-
#palindrome? ⇒ Boolean
Returns true for palindrome, false otherwise.
Instance Method Details
#letters ⇒ Object
Returns the letters in the string
14 15 16 |
# File 'lib/browngw_palindrome.rb', line 14 def letters self.chars.select { |c| c.match(/[a-z]/i) }.join end |
#palindrome? ⇒ Boolean
Returns true for palindrome, false otherwise
9 10 11 |
# File 'lib/browngw_palindrome.rb', line 9 def palindrome? processed_content == processed_content.reverse end |