Sha256: 7f41f0723ecf17d17b5c5737e449adbb6b98f876f675d5fe6fd4306bce80be7d

Contents?: true

Size: 323 Bytes

Versions: 2

Compression:

Stored size: 323 Bytes

Contents

require "lgrgic_palindrome_detector/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

2 entries across 2 versions & 1 rubygems

Version Path
lgrgic_palindrome_detector-0.2.0 vendor/cache/gems/lgrgic_palindrome_detector-0.1.0/lib/lgrgic_palindrome_detector.rb
lgrgic_palindrome_detector-0.1.0 lib/lgrgic_palindrome_detector.rb