Sha256: 1640dafb01cc1571fb602d00da78407d2206bf2ce126f18c88d0f25eb10fbc6a

Contents?: true

Size: 314 Bytes

Versions: 1

Compression:

Stored size: 314 Bytes

Contents

require "toninjaa_palindrome/version"

class String

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

  private

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toninjaa_palindrome-0.1.0 lib/toninjaa_palindrome.rb