Sha256: 70dbba8e82461b004676f691bf9bf44e4e6108ddffabfa087a26451bb9a8832e

Contents?: true

Size: 304 Bytes

Versions: 1

Compression:

Stored size: 304 Bytes

Contents

require 'kmff_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
kmff_palindrome-0.1.0 lib/kmff_palindrome.rb