Module: BrowngwPalindrome

Included in:
Integer, String
Defined in:
lib/browngw_palindrome.rb,
lib/browngw_palindrome/version.rb

Constant Summary collapse

VERSION =
"0.2.0"

Instance Method Summary collapse

Instance Method Details

#lettersObject

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/browngw_palindrome.rb', line 9

def palindrome?
  processed_content == processed_content.reverse
end