aadigamov_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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f36e3643953e42503fab2dd463ef1390f8fe2940677a54bec29bf4ea54bb3f65
4
- data.tar.gz: 3286b0507999f3ae793c55979efbd96f8f066ffdf9868cfdd26da7a160e02c38
3
+ metadata.gz: dba9d473e753417e64869e46a3fbeb75758dd8957f938c6dfb73cb1088ef6b1d
4
+ data.tar.gz: 7698f40d03d26fa1e3066b2ba0e45032f2f4f00f8fea6ee55d5e11a01ebc39ad
5
5
  SHA512:
6
- metadata.gz: 2b5c5b76f293971214b00f63f6e471940eab36fa0f410ab134fee37b0a52edbb051f1a2c9d60639e7c1f8a0b3075c1ae8c04a40e441c8acaeb5e757a5472819d
7
- data.tar.gz: 90723f8f593e3cb9944502e79d7d7c38b9131c1d708f9aea4db04acb7aeca67a0a3a44c94ad3fd2d48dc09c44822a377343cb4a13517f00caeebc237193da767
6
+ metadata.gz: ea2f8a23d6c74bbf2b2b4065201c51a561d26078b77df0dbb6bb262f175fee1304a100c681404144b1f70e0a1d3467dbce93bc0c4e2db167e33f8579db6bbdac
7
+ data.tar.gz: 84587b9355c2ed0b96fec4f3899ab1d33e24b9389e49ae712e57142b63e972d8d4fc412207b180948d9391cb701d367412f65feafbda8486e9f05c1d0b6cf234
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aadigamov_palindrome (0.1.0)
4
+ aadigamov_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,14 +1,27 @@
1
1
  require "aadigamov_palindrome/version"
2
2
 
3
+ module AadigamovPalindrome
4
+
5
+ # Returns true for a palindrome, false otherwise.
6
+ def palindrome?
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
12
+ end
13
+
14
+ private
15
+ # Returns content for palindrome testing.
16
+ def processed_content
17
+ self.to_s.scan(/[a-zA-Z\d]/).join.downcase
18
+ end
19
+ end
20
+
3
21
  class String
4
- # Returns true fo a palinrome, false otherwise.
5
- def palindrome?
6
- processed_content == processed_content.reverse
7
- end
8
-
9
- private
10
- # Returns content for palindrome testing.
11
- def processed_content
12
- self.scan(/[a-z]/i).join.downcase
13
- end
22
+ include AadigamovPalindrome
14
23
  end
24
+
25
+ class Integer
26
+ include AadigamovPalindrome
27
+ end
@@ -1,3 +1,3 @@
1
1
  module AadigamovPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aadigamov_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AntonAdigamov