Module: TheweepingwillPalindrome

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

Constant Summary collapse

VERSION =
"0.4.0"

Instance Method Summary collapse

Instance Method Details

#palindrome?Boolean

Returns true if a string is a palindrome, else it returns false

Returns:

  • (Boolean)


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

def palindrome? 
 pc.empty? == false && pc == pc.reverse
end