paco_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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/paco_palindrome/version.rb +1 -1
- data/lib/paco_palindrome.rb +10 -2
- 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: 82979554c40f25051fc6d2000e15ba9e9982719608338361c22c47fddfff8f1a
|
4
|
+
data.tar.gz: 17efacf1a558cbc4b7abac4ba447e08ec389009995067d50c8fc38ddf0c5c5f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd1e7ea8b0527ca62ef8552a658e37d4d6324db286ceb49e0bc3082e72106971ccec3874d8e81c56cda0281d7adf933108d421b499578fb08b5fd814e74d8afb
|
7
|
+
data.tar.gz: da4211834536bd80ec52b733fedede4ea9961c3383f971a345411b55f5ccb3b1e891b9ae47c575b37b72b97f501e985e2b89265c71268672d3c54e1e078ff3ff
|
data/Gemfile.lock
CHANGED
data/lib/paco_palindrome.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "paco_palindrome/version"
|
4
4
|
|
5
|
-
|
5
|
+
module PacoPalindrome
|
6
6
|
|
7
7
|
# Returns true for a palindrome, false otherwise.
|
8
8
|
def palindrome?
|
@@ -13,6 +13,14 @@ class String
|
|
13
13
|
|
14
14
|
# Returns content for palindrome testing.
|
15
15
|
def processed_content
|
16
|
-
scan(/[a-
|
16
|
+
self.to_s.scan(/[a-z0-9]/i).join.downcase
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
class String
|
21
|
+
include PacoPalindrome
|
22
|
+
end
|
23
|
+
|
24
|
+
class Integer
|
25
|
+
include PacoPalindrome
|
26
|
+
end
|