Sha256: 505f73cd1f50d9dc84243fc24f38ce49675bfec7cb08e04053e4509c3c79cf3b
Contents?: true
Size: 374 Bytes
Versions: 1
Compression:
Stored size: 374 Bytes
Contents
require "tbddev_palindrome/version" class String # Returns true for a palindrome, false otherwise. def palindrome? proccesed_content == proccesed_content.reverse end private # Returns content for palindrome testing. def proccesed_content scan(/[a-z]/i).join.downcase #self.chars.select { |character| character.match(/[a-z]/i) }.join end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tbddev_palindrome-0.1.0 | lib/tbddev_palindrome.rb |