Sha256: 719da05287b1a6e8248303887ae93f09346fbf8c3991af63c887a75110b517d9

Contents?: true

Size: 324 Bytes

Versions: 2

Compression:

Stored size: 324 Bytes

Contents

require "hsztan_palindrome/version"

module HsztanPalindrome

  def palindrome?
    processed_content == processed_content.reverse
  end

  private

    def processed_content
      self.to_s.scan(/[a-z\d]/i).join.downcase
    end
end

class String
  include HsztanPalindrome
end

class Integer
  include HsztanPalindrome
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hsztan_palindrome-0.2.1 lib/hsztan_palindrome.rb
hsztan_palindrome-0.2.0 lib/hsztan_palindrome.rb