Sha256: f2fbf2245f03999b55fad8ef06a9b34c6fc63fdd15e8d051e35a75d727afadea

Contents?: true

Size: 320 Bytes

Versions: 1

Compression:

Stored size: 320 Bytes

Contents

require "torischuyler_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
torischuyler_palindrome-0.1.0 lib/torischuyler_palindrome.rb