Sha256: e039920bcbb10b3e9877c2bc466756696096bd18079687cff9ec3470a978a611

Contents?: true

Size: 333 Bytes

Versions: 4

Compression:

Stored size: 333 Bytes

Contents

$LOAD_PATH << '.'

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

4 entries across 3 versions & 1 rubygems

Version Path
wfrey_palindrome-0.3.0 vendor/bundle/ruby/2.3.0/gems/wfrey_palindrome-0.1.0/lib/wfrey_palindrome.rb
wfrey_palindrome-0.2.0 vendor/bundle/ruby/2.3.0/gems/wfrey_palindrome-0.1.0/lib/wfrey_palindrome.rb
wfrey_palindrome-0.1.0 lib/wfrey_palindrome.rb
wfrey_palindrome-0.1.0 vendor/bundle/ruby/2.3.0/gems/wfrey_palindrome-0.1.0/lib/wfrey_palindrome.rb