nwoliver_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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nwoliver_palindrome.rb +13 -12
- data/lib/nwoliver_palindrome/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 232fa1d783b404127f8cd3d8aa0c2a4e7023e8c04166f67c09c399bde29341cf
|
|
4
|
+
data.tar.gz: db172e6656bc11b841f7d27391c3667fdc4f2ae1ccb2a1c612cf220ba41a7967
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12f1aa93dd53925c87b106dd7280df728d852cd3686ab27ccdd7d823904b342b9e1567329d85b9762563f137f894a474a33149b475f5bba5bd6dc0c2e8148ad4
|
|
7
|
+
data.tar.gz: 6225e803744d7d09a09dee437bd0aee420247b5973c3ec64e602ea486c01d8f0e8fee4f44cfa9f991c9d8e2f546344a7442892e5ca3e42160a3f23dcc649a586
|
data/Gemfile.lock
CHANGED
data/lib/nwoliver_palindrome.rb
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
require "nwoliver_palindrome/version"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class String
|
|
9
|
-
|
|
10
|
-
def palindrome?
|
|
11
|
-
processed_content == processed_content.reverse
|
|
12
|
-
end
|
|
3
|
+
module NwoliverPalindrome
|
|
4
|
+
def palindrome?
|
|
5
|
+
processed_content == processed_content.reverse
|
|
6
|
+
end
|
|
13
7
|
|
|
14
|
-
private
|
|
8
|
+
private
|
|
15
9
|
# Returns content for palindrome testing
|
|
16
10
|
def processed_content
|
|
17
|
-
self.scan(/[a-z]/i).join.downcase
|
|
11
|
+
self.to_s.scan(/[a-z\d]/i).join.downcase
|
|
18
12
|
end
|
|
19
13
|
end
|
|
14
|
+
|
|
15
|
+
class String
|
|
16
|
+
include NwoliverPalindrome
|
|
17
|
+
end
|
|
18
|
+
class Integer
|
|
19
|
+
include NwoliverPalindrome
|
|
20
|
+
end
|