Sha256: 69d31caf0b42892772a83559dd828ca7a4a12da4362f9d16946aec6d8e778421

Contents?: true

Size: 313 Bytes

Versions: 2

Compression:

Stored size: 313 Bytes

Contents

require "dmurphy_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

2 entries across 1 versions & 1 rubygems

Version Path
dmurphy_palindrome-0.1.0 lib/dmurphy_palindrome.rb
dmurphy_palindrome-0.1.0 vendor/cache/ruby/2.3.0/gems/dmurphy_palindrome-0.1.0/lib/dmurphy_palindrome.rb