snoseeds_palindrome 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snoseeds_palindrome/version.rb +1 -1
- data/lib/snoseeds_palindrome.rb +11 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9acfaa6447e01bd463bb00c7e7b905878b6aeab71f6d1ce16ae44653373b8e79
|
4
|
+
data.tar.gz: 70d87a6726fcc9a2428301a7c9fb760f69649edc463eb1af205494953df3bd85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3683f34c81c25496459b6699e8241cda0804240d9478f8815510089aba60e5e161e40ea7ba2980453ce72ab208a1f650dbcd599ab7e08b0e016093490d9cac7b
|
7
|
+
data.tar.gz: 07b7b292488e49d0157a40a4e2f29c42eba685269812f5e7cca1a50b38d3f25cc333b72ed6a54ba82fcb2f1e30371349fb67171d817dc2b3aefe9f7cbd6317a4
|
data/lib/snoseeds_palindrome.rb
CHANGED
@@ -2,22 +2,24 @@
|
|
2
2
|
|
3
3
|
require_relative "snoseeds_palindrome/version"
|
4
4
|
|
5
|
-
|
6
|
-
# class Error < StandardError; end
|
7
|
-
# # Your code goes here...
|
8
|
-
# end
|
9
|
-
|
10
|
-
class String
|
11
|
-
|
5
|
+
module SnoseedsPalindrome
|
12
6
|
# Returns true for a palindrome, false otherwise.
|
13
7
|
def palindrome?
|
14
|
-
processed_content == processed_content.reverse
|
8
|
+
processed_content.length > 0 && processed_content == processed_content.reverse
|
15
9
|
end
|
16
10
|
|
17
11
|
private
|
18
12
|
|
19
13
|
# Returns content for palindrome testing.
|
20
14
|
def processed_content
|
21
|
-
scan(/[a-z]/i).join.downcase
|
15
|
+
to_s.scan(/[a-z\d]/i).join.downcase
|
22
16
|
end
|
23
17
|
end
|
18
|
+
|
19
|
+
class String
|
20
|
+
include SnoseedsPalindrome
|
21
|
+
end
|
22
|
+
|
23
|
+
class Integer
|
24
|
+
include SnoseedsPalindrome
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snoseeds_palindrome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nurudeen Soremekun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Learn Enough Ruby Palindrome Detector
|
14
14
|
email:
|