Palindrome Detector
michaeldewolf85_palindrome
is a sample Ruby gem created in Learn Enough Ruby to be Dangerous by Michael Hartl.
Installation
To install michaeldewolf85_palindrome
, add this line to your applications Gemfile
:
gem 'michaeldewolf85_palindrome`
Then install as follows:
bundle install
Or install it directly using gem
:
gem install michaeldewolf85_palindrome
Usage
michaeldewolf85_palindrome
adds a palindrome?
method to the String
class, and can be used as follows:
$ irb
>> require 'michaeldewolf85_palidrome'
>> "honey badger".palindrome?
=> false
>> "deified".palindrome?
=> true
>> "Able was I, ere I saw Elba."
=> true
>> phrase = "Madam, I'm Adam."
>> phrase.palindrome?
=> true