evadyke_palindrome 0.1.1 → 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: a9b6d18ccbb840803d0abcedfde5cc327c0663d8787c6c12fab360ddfa730145
4
- data.tar.gz: '004386f087508675e07fb91d6a2a3f31c5356daca92c4a69e60f8b84b75b187a'
3
+ metadata.gz: 4cb20923a608ec3c98d89bff04d371b87ceae334705ead2ea5605c29f3a8193e
4
+ data.tar.gz: 803a3e3247eb5ad9aa530518aab4a272961428161ee90aa52ac8d6dcebef5aa1
5
5
  SHA512:
6
- metadata.gz: b2cc4b2ce9a1cdc54b543c3b9f13ad94d0e89a45df211790ec973e27a62322bca8c1422b9f53b77037d930ba3a692e2086039dfa6d14440eb44fec6ccdf9c2ad
7
- data.tar.gz: 638de3703590b1c1ab43913e810cea507e404bbf94f18b179f28225a8d4c4b5dea083b4e1cd12b343eb7b4ff4a1aba93fb55437ac5c438400da69e2744d98edb
6
+ metadata.gz: b4091ee8fe05689ccb86c789825156b02044df0ca1dcf1e2f33aec6531983a3273e736649258f67f3f70f9c01a96bf73d13c912cb67fc0b1243d3ff43de3c268
7
+ data.tar.gz: 5fd61ae3ac657eaba6266ba01cab7e4316913688abd38e38a285e733f0aa406b87dc04e29a383696d7987b7a2c3068ab8e79ad07e10a6ce21024eff44772180a
@@ -1,12 +1,28 @@
1
1
  require "evadyke_palindrome/version"
2
- class String
2
+
3
+ module EvandykePalindrome
4
+ # Returns true for a palindrome, false otherwise.
3
5
  def palindrome?
4
- processed_content == processed_content.reverse
6
+ if processed_content.empty?
7
+ false
8
+ else
9
+ processed_content == processed_content.reverse
10
+ end
5
11
  end
6
12
 
7
13
  private
14
+
15
+ # Returns content for palindrome testing.
8
16
  def processed_content
9
- self.scan(/[a-z]/i).join.downcase
17
+ self.to_s.scan(/[a-z\d]/i).join.downcase
10
18
  end
11
19
  end
12
20
 
21
+
22
+ class String
23
+ include EvandykePalindrome
24
+ end
25
+
26
+ class Integer
27
+ include EvandykePalindrome
28
+ end
@@ -1,3 +1,3 @@
1
1
  module EvadykePalindrome
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evadyke_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elizabeth Van Dyke
@@ -68,6 +68,7 @@ files:
68
68
  - bin/console
69
69
  - bin/setup
70
70
  - evadyke_palindrome-0.1.0.gem
71
+ - evadyke_palindrome-0.1.1.gem
71
72
  - evadyke_palindrome.gemspec
72
73
  - lib/evadyke_palindrome.rb
73
74
  - lib/evadyke_palindrome/version.rb