asyroyez_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: 46b78463a67c7471e15dd0e35d302d2cb69a8a96dea2446ab2223dd84f5b3af2
4
- data.tar.gz: 4d43602120eaf18210e8834176f9c100b3df5033d9b3a46565d0d696ab88949b
3
+ metadata.gz: da81b3209d6a93f141b60f1c0debe88294cdf5de4d71a7b63378f7bc77868638
4
+ data.tar.gz: 5f8319a6af4cedb8906879cb0f96eed0a3775f314885fde36dd6617b5fd32248
5
5
  SHA512:
6
- metadata.gz: f5b44779d2abfef78f74c0ce351e0c4dcc5592bc10928fe3411be31b3cc1a083c1870fdab24d43bfcf65153f96142f5c98f51087a1a04c0686a2df8567a5cb8e
7
- data.tar.gz: 61e458fbb1e92b07a0d51bff64a0252782b71c311783cd03a9ba8c54160b8fbc5db041dbcf02af48a1d83ffeb0d24a528d07a62dd352c512a5e4fbafda4c26f9
6
+ metadata.gz: f19ac1908d5993b2b4dcffc42f5eeebf358ea583fa277a6533694336f0e153565fa7587c2c7afeda45443dbe822d2a78d2b8ee8bd5b0a1e14e8b58c8050a4f9d
7
+ data.tar.gz: 2b91d589f57b01c959ed052a9f815594ee3fa5a826e077bfc3f55d588e8cc75bd62027511e0fd75305e532e8caff6271d44447769d0ec6a9b39b143fe0dc7ec8
@@ -1,3 +1,3 @@
1
1
  module AsyroyezPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require "asyroyez_palindrome/version"
2
2
 
3
- class String
3
+ module AsyroyezPalindrome
4
4
  # Returns true for a palindrome, false otherwise.
5
5
  def palindrome?
6
6
  processed_content == processed_content.reverse
@@ -10,6 +10,14 @@ class String
10
10
 
11
11
  # Returns content for palindrome testing
12
12
  def processed_content
13
- scan(/[a-z]/i).join.downcase
13
+ to_s.scan(/[a-z\d]/i).join.downcase
14
14
  end
15
15
  end
16
+
17
+ class String
18
+ include AsyroyezPalindrome
19
+ end
20
+
21
+ class Integer
22
+ include AsyroyezPalindrome
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asyroyez_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
  - Andrey Syroyezhkin