Sha256: 1b71f147db9303ae879412ce0969297ea05b4230497f12bac83e52a4896d81fc
Contents?: true
Size: 521 Bytes
Versions: 1
Compression:
Stored size: 521 Bytes
Contents
# frozen_string_literal: true require_relative "alanriverogorinstein_palindrome/version" module AlanriverogorinsteinPalindrome # 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.to_s.scan(/[a-z\d]/i).join.downcase end end class String include AlanriverogorinsteinPalindrome end class Integer include AlanriverogorinsteinPalindrome end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alanriverogorinstein_palindrome-0.2.0 | lib/alanriverogorinstein_palindrome.rb |