Sha256: bb07c047499d8cf8267f0e511e047dead2e5f8b95a37cb3f41793ea57df5528f

Contents?: true

Size: 419 Bytes

Versions: 1

Compression:

Stored size: 419 Bytes

Contents

require "trontz_palindrome/version"

# module TrontzPalindrome
#   class Error < StandardError; end
#   # Your code goes here...
# end

class String
  
  # Returns true for a palindrome, false otherwise 
  def palindrome?
    processed_content == processed_content.reverse
  end

  private

    # Returns content for palindrome comparison 
    def processed_content
      self.scan(/[a-z]/i).join.downcase
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trontz_palindrome-0.1.0 lib/trontz_palindrome.rb