ashvinps_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: cf199c40a577273881f53ca6ad89f14cc69da67eec05de318b318d3760640e46
4
- data.tar.gz: a3d7f16c02b407b672b4c360c6b363278dfd99bf0aaf32db2ee29cd01f381bb4
3
+ metadata.gz: 7a143632d2efde2ac16831d47cebfa27660dcf1ab9f3a65da87c64f5a4c9dd5b
4
+ data.tar.gz: e8eab7b5c5c68b286db069ff672b5cffe95cae390848414aa8d2cb9b604cd2b4
5
5
  SHA512:
6
- metadata.gz: 0dfe633f93283a2e94927c79d300433814cf462e603748205c4b9cebecda3248943bbefaee132b81da92338602d0a74e810344cfe93dfa390fd41f02040379a1
7
- data.tar.gz: ace866fdf401f3ba48e93d75c4921e0bf02b3922037108c51b7e94cb77eba2395685d66d13eceb0783522067b467b3f2d5e46d8c2ffceb4c49d2702093b19263
6
+ metadata.gz: bb0f7273bbfce1758f5e3e0fef45c75f7e372b36b8a184d16c393605001bd95a4fc2002a20953ea4c297f0fbac05fa638d416f895ab53b9d91416a1f4954853d
7
+ data.tar.gz: 710caf925730651a3a8494d48f2faa1b27fbd1b91432fc4ecead39dd6f8d4377266fa24198e8d4206cec0688bfe7a82830d3f89f9f7bc2a3ff268d5bdf4c6a6f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ashvinps_palindrome (0.1.0)
4
+ ashvinps_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,15 +1,27 @@
1
1
  require "ashvinps_palindrome/version"
2
2
 
3
- class String
3
+ module AshvinpsPalindrome
4
4
 
5
5
  def palindrome?
6
- processed_content == processed_content.reverse
6
+ if processed_content.empty?
7
+ false
8
+ else
9
+ processed_content == processed_content.reverse
10
+ end
7
11
  end
8
12
 
9
13
 
10
14
  private
11
15
 
12
16
  def processed_content
13
- self.gsub(/[^a-zA-Z0-9]/, '').downcase
17
+ self.to_s.gsub(/[^a-zA-Z0-9]/, '').downcase
14
18
  end
15
19
  end
20
+
21
+ class String
22
+ include AshvinpsPalindrome
23
+ end
24
+
25
+ class Integer
26
+ include AshvinpsPalindrome
27
+ end
@@ -1,3 +1,3 @@
1
1
  module AshvinpsPalindrome
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: ashvinps_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
  - Ashvin Pradhan-Shenoy