romenigld_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: 47bbff1bf7c4b7b91b98fef38c1e94dc2b7104933e9df783e1991e5b66f54b17
4
- data.tar.gz: b8fe58ef8d243fd08bee7e6a9e85a0c9caa5cac8fe393ed8b2f81ba4cd7e1cec
3
+ metadata.gz: aa760f52c4c427350add78b6250f251c5c20df457a5898d9cdde54803515d2f2
4
+ data.tar.gz: b5f632a32057a8643a7f3d8e650aa718cae2cebb0b61946e84d041b54e37aaa3
5
5
  SHA512:
6
- metadata.gz: a595ced9b1c84bc08135dc382b6677d472be687cf66dfc41a55e635761506a5aec3d072b0a1d1dcd496ef75b76917ee3e3f2da4fa25f166b59fe4e41f579eba3
7
- data.tar.gz: 11efba912f954df4789a0a23f81af7faef6d34a455d3571e8993a0a2c0f406ce53ec06b62f3ab9ac23bc01c8a4bf582fec2814e05248ab89712d7027b8325fa0
6
+ metadata.gz: ba38e34895add0ca5cbaf717890e971211b4d5ebcc5caa7357f582349f9e51a6adff7b25b5fea9ea8f4c3a7231cd2e9dfaf080379ad04e1d9bad5b169f31df4c
7
+ data.tar.gz: f1ba1d4e34fef7c500ed6c144f35cc14540ae553f4fee7d191a6f797e0c033280605c20526729adb62fbdf84cca7a2ad00b604b72f290eaeb66cdad72d0102ef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- romenigld_palindrome (0.1.0)
4
+ romenigld_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module RomenigldPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,16 +1,28 @@
1
1
  require "romenigld_palindrome/version"
2
2
 
3
- class String
3
+ module RomenigldPalindrome
4
4
 
5
5
  # Returns true for a palindrome, false otherwise.
6
6
  def palindrome?
7
- processed_content == processed_content.reverse
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
8
12
  end
9
13
 
10
14
  private
11
15
 
12
16
  # Returns content for palindrome testing.
13
17
  def processed_content
14
- self.scan(/[a-z]/i).join.downcase
18
+ self.to_s.scan(/[a-z\d+]/i).join.downcase # or can use the Regex /[a-z0-9]/i
15
19
  end
16
20
  end
21
+
22
+ class String
23
+ include RomenigldPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include RomenigldPalindrome
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: romenigld_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
  - Romenig Lima Damasio