kaszakin_palindrome 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: d11a26f4b31e648c300b828dbbb347783667777d
4
- data.tar.gz: 2cfa65879c6ad98ba2d3b2782d44cb5106798e2c
3
+ metadata.gz: 823e098e488cb32f3526ff7f1ad76968e07c01f9
4
+ data.tar.gz: 92e6ad394041c524563c103d4f5be77bb81fad72
5
5
  SHA512:
6
- metadata.gz: 1ecae1a9462ccea8a3e58884b4d5cbcc85cbbd6438039d712a02309ef4630c63b99e01bb00570ee7bd4167d21453495f2b2662794bd0f64284be847cbc975409
7
- data.tar.gz: 198c275f86e10c9eaf99ff39c58ab0f9093eada5a582a1d7b965e77a4e4872d026bb2a77a4fcedc9a02a7d101e2346bc55c560d8703ccc3ff4dacbe3c97fa7d4
6
+ metadata.gz: 64b789cbe782bfcf738c5ae85546fa2c3de23b73223337a5d14730ccab563830f61c8db139b1ba597ded1860b7d896375a0ee5786c523b1556229899241547bc
7
+ data.tar.gz: 7e988b1de3e867c58485e7eb452057cc6aa03197b837af429572eda8a6ce4c10fcd31955383e7c5dbfd21c1e64843d17fe54a09e00f9c7307ac84d3608626ea5
@@ -1,12 +1,27 @@
1
1
  require "kaszakin_palindrome/version"
2
2
 
3
- class String
3
+ module KaszakinPalindrome
4
+
4
5
  def palindrome?
5
- processed_content == processed_content.reverse
6
+ if processed_content.empty?
7
+ false
8
+ else
9
+ processed_content == processed_content.reverse
10
+ end
6
11
  end
7
12
 
8
13
  private
9
- def processed_content
10
- self.scan(/[a-z]/i).join.downcase
11
- end
14
+
15
+ def processed_content
16
+ self.to_s.scan(/[a-z\d]/i).join.downcase
17
+ end
18
+ end
19
+
20
+
21
+ class String
22
+ include KaszakinPalindrome
23
+ end
24
+
25
+ class Integer
26
+ include KaszakinPalindrome
12
27
  end
@@ -1,3 +1,3 @@
1
1
  module KaszakinPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaszakin_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mj