andyh82_palindrome 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc3f8ebb74f510b86c04f6bcb8cfeb0939e275f2a440be9735aadb1a5f0d256a
4
- data.tar.gz: 648147f1251ee4f38ce3f76d2c18dedd380564294a0a7f337c2ea2e58b03fd3c
3
+ metadata.gz: 374066c3420f0b0c051c712968ebc2f0f6676ca9bac932ffe2e4ef1bf8269d2f
4
+ data.tar.gz: '07892369c537b65ac6b73ead99b46c1770f246257348e092c98546034bcd73e3'
5
5
  SHA512:
6
- metadata.gz: 929a8f894d53968e208816663bbb6f12fa8e7e991a6216819b82c4321260a28b1cb09102b07c9be6b7eb990273d164f88582cff08e925fb070016e73ab9c2de6
7
- data.tar.gz: cab94b467626bfe5b990a1b2a29231346a662be4ed7e5fcd1ef780a376deae0cf5369eccf20d11d7ee1ec4e81af14d81450210819ba642111cdb7a2fee0ed36a
6
+ metadata.gz: db1d3c6eb34fcbeb2fb970cee50852961379092b8eee7d2ef6e0c7154a8f97730189227683f0ce039536a50aea2f0ce4178f4067473200106f3fd9f92dbd486c
7
+ data.tar.gz: b888b32647e5fcd9b687406cdbd1579f37316b4aa48f3039699a378bfc0c3df8116b0cf89f0c9900061c3d986caff9fa4da09738e29b2371ad4327324132811c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- andyh82_palindrome (0.1.0)
4
+ andyh82_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "andyh82_palindrome/version"
4
4
 
5
- class String
5
+ module Andyh82Palindrome
6
6
  # Returns true for a palindrome, false otherwise.
7
7
  def palindrome?
8
8
  processed_content == processed_content.reverse
@@ -12,6 +12,14 @@ class String
12
12
 
13
13
  # Returns content for palindrome testing.
14
14
  def processed_content
15
- scan(/[a-z]/i).join.downcase
15
+ to_s.scan(/[a-z1-9]/i).join.downcase
16
16
  end
17
+ end
18
+
19
+ class String
20
+ include Andyh82Palindrome
21
+ end
22
+
23
+ class Integer
24
+ include Andyh82Palindrome
17
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Andyh82Palindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: andyh82_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Huntington