Sha256: 54109f51ffb0bea6388bd5a150e0f653d9a6edffab2ea11f1e4dc02e716501ea

Contents?: true

Size: 313 Bytes

Versions: 1

Compression:

Stored size: 313 Bytes

Contents

require "Yassoabi_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
Yassoabi_palindrome-0.1.0 lib/Yassoabi_palindrome.rb