Module: NymousPalindrome

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

Constant Summary collapse

VERSION =
"0.2.0"

Instance Method Summary collapse

Instance Method Details

#palindrome?Boolean

Test if a String is a palindrome (ie it reads the same from left to right and from right to left)

Examples:

"not a palindrome".palindrome? #=> false
"Racecar".palindrome? #=> true

Returns:

  • (Boolean)


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

def palindrome?
  processed_content == processed_content.reverse
end