kb_palindrome 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fafc02c809e1409be271213561fbb293cfb9b3ab211d87380dfcbc59d47bb9a6
4
- data.tar.gz: 179262210c162f02f425f4261f95a416aa68794b6c4f9fed7f03ec054898755f
3
+ metadata.gz: fa4d173103c5b297f567aa3f846a516fcd868e7c8e543437b5bc59f8d4532487
4
+ data.tar.gz: 2f6f8412a889b91d128975688dd7b78f335c52c2159c928c94a43252f6dcec46
5
5
  SHA512:
6
- metadata.gz: 76faaf07bde712695949e5e4a2ffb6c82c7d7bbb558980a3163e7aa3c4522d5279f605ac07c04684a067847d9ad2043b53ed7f16dcaa64849730d743e7a35201
7
- data.tar.gz: e5cf11a56e291ba27f7e0de56feb5bf76d75d7bd20cf281e9c2bda31e6a18e20cfef180ef873633f1cb11a482e58ec1427cee5346abc4c8f1f3e4bc11fd34e54
6
+ metadata.gz: abc21f452939040e89bae71afd7f204fc7d26c41d39a37cb0c93935a762a50544557b4f35dee6c256346878a744e502d40836bf02eb8c880cb24b65ae79ff5d3
7
+ data.tar.gz: d38a405a6dc50b16a845e710040df0e7b27b679e28699770dca72ad82a6f0118cd311be0f7482ba59347d066bc8aea7131320e8e18510cd7bee6434d7b7b4f0c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kb_palindrome (0.1.0)
4
+ kb_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/kb_palindrome.rb CHANGED
@@ -1,16 +1,28 @@
1
1
  require "kb_palindrome/version"
2
2
 
3
- class String
3
+ module KbPalindrome
4
4
 
5
5
  # Returns true for a palindrome, false otherwise.
6
6
  def palindrome?
7
- processed_content == processed_content.reverse
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
8
12
  end
9
13
 
10
14
  private
11
15
 
12
16
  # Returns content for palindrome testing.
13
17
  def processed_content
14
- self.scan(/[a-z]/i).join.downcase
18
+ self.to_s.scan(/[a-z0-9]/i).join.downcase
15
19
  end
16
20
  end
21
+
22
+ class String
23
+ include KbPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include KbPalindrome
28
+ end
@@ -1,3 +1,3 @@
1
1
  module KbPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kb_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
  - Kayla Broussard