fantastic_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/fantastic_palindrome.rb +10 -2
- data/lib/fantastic_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: 2e207c00d7e9095170f41bc1a68ca5116cf54bf72606db7dc47d449df410ed23
|
4
|
+
data.tar.gz: 2b5905bef7d21531003710f404c92467eeb229a1f9affe959bc484d6337ba33c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42be08db7fcac04b90fdc4179ed90e45036b388bcf789fc2cc244a6cd887bc88498edc8903b185cc6aed6d23ce015519f67954d585b25983802d248e35a42724
|
7
|
+
data.tar.gz: da5d6d23bf266fef4119d1805ce808bb1e96bb56131d7cec5d05c2d476b5d8f7eb4bf06a154dbd03b21a7040a3026d0fe29a6b93470d6bc48ef38e37dd143714
|
data/Gemfile.lock
CHANGED
data/lib/fantastic_palindrome.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "fantastic_palindrome/version"
|
2
2
|
|
3
|
-
|
3
|
+
module FantasticPalindrome
|
4
4
|
|
5
5
|
# Returns true for a palindrome, false otherwise.
|
6
6
|
def palindrome?
|
@@ -11,6 +11,14 @@ class String
|
|
11
11
|
|
12
12
|
# Returns content for palindrome testing.
|
13
13
|
def processed_content
|
14
|
-
self.scan(/[a-z]/i).join.downcase
|
14
|
+
self.to_s.scan(/[a-z\d]/i).join.downcase
|
15
15
|
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class String
|
19
|
+
include FantasticPalindrome
|
20
|
+
end
|
21
|
+
|
22
|
+
class Integer
|
23
|
+
include FantasticPalindrome
|
16
24
|
end
|