Sha256: de64ccd983c53d692c852681d69e5f684f88c9c59f8f69980fd802cfb4f370c3

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

require "jenstreetman_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
jenstreetman_palindrome-0.1.0 lib/jenstreetman_palindrome.rb