Sha256: 7d449d94e4e93b23a0e89d4b3a4b63b9912e090b44d9c36d9901302d291303ba

Contents?: true

Size: 334 Bytes

Versions: 1

Compression:

Stored size: 334 Bytes

Contents

require "kparsons_palindrome/version"

module KparsonsPalindrome

  def palindrome?
    processed_content == processed_content.reverse
  end

  private

    def processed_content
      self.to_s.scan(/[a-z0-9]/i).join.downcase
    end
end

class String
  include KparsonsPalindrome
end

class Integer
  include KparsonsPalindrome
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kparsons_palindrome-0.2.0 lib/kparsons_palindrome.rb