a89529294_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/a89529294_palindrome/version.rb +1 -1
- data/lib/a89529294_palindrome.rb +12 -3
- 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: 90804f7da42e087a58d7c1d2586bdfa0846b494c1652f447f39c16659d90edb3
|
4
|
+
data.tar.gz: 5ebb157d607e6052c39a2604fa26ddf292c71126c8ecf5224c303156c54cfc6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ba406d735b48a79ca286b8c94506c8e9f19ada4fb2a4d8bf420d45e7b6ae7e5e8bf8ce610be4d58ad73ea515f41422b22eeb2f5913b7d2fa40bf60ac1694a45
|
7
|
+
data.tar.gz: 0c2bf47aa7f263152b6062a01692ffee7371867da44320779409f1d302e8d00b1533ac27771b4dc9efa37e158a15d2e49136bfbe51e6ec2640efe42e7ab2722d
|
data/Gemfile.lock
CHANGED
data/lib/a89529294_palindrome.rb
CHANGED
@@ -1,15 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "a89529294_palindrome/version"
|
4
|
-
|
5
|
-
|
4
|
+
module A89529294_palindrome
|
5
|
+
# Returns true for a palindrome, false otherwise.
|
6
6
|
def palindrome?
|
7
7
|
processed_content == processed_content.reverse
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
+
# Returns content for palindrome testing.
|
12
13
|
def processed_content
|
13
|
-
scan(/
|
14
|
+
to_s.scan(/\w/).join.downcase
|
14
15
|
end
|
15
16
|
end
|
17
|
+
|
18
|
+
class String
|
19
|
+
include A89529294_palindrome
|
20
|
+
end
|
21
|
+
|
22
|
+
class Integer
|
23
|
+
include A89529294_palindrome
|
24
|
+
end
|