agiantbird_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
  SHA256:
3
- metadata.gz: 3175e1aed8b7326254de0680561f605afb299ecab70c7f17ead53f7578239383
4
- data.tar.gz: 7c34362c784575d4210fdda70c1b405442c54e83725574abf3661bfb4414d93e
3
+ metadata.gz: 13e3ad2ca175fffa05c33cadb61d3833c3e058e56ab26197fffd6771b5f899c2
4
+ data.tar.gz: ce4b46cacb3e14baf22938c97c6d2da305634e454b88fcb7a0b45bf1866aeb5d
5
5
  SHA512:
6
- metadata.gz: 14cbc5148dacc94b314a2ea49b1504bdc9062b57fe1e3df4fe09165eed4593e2e9125bbe8d0ce7ecd349c5e01cc99723b2938903a57b0f61b2e95595995db8de
7
- data.tar.gz: 4d171040762706db95810bc3b25b588221e682d6961011107edbcc1d664f95621a1d4b072ce935735f2974416d32883a4626993384b702f193e5349aa7ccd82b
6
+ metadata.gz: 75bac832c0246b540187fcc005df90956e9c4e9a12f922d4cbf3739570370c98b7a5c1e5bd0cd369082c97b3e61338c54460e63f442c6b6070391ddd4e5216c3
7
+ data.tar.gz: fcbc8c5bdc3a4b2af5bd6c0ddbe80114ccac77eac2d4118e478f1bf91011db7565cefa175d1216cb96b8fe589b7d554081e45e1725aaf6302686120911fcb770
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- agiantbird_palindrome (0.1.0)
4
+ agiantbird_palindrome (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,18 +1,28 @@
1
1
  require "agiantbird_palindrome/version"
2
2
 
3
- class String
3
+ module AgiantbirdPalindrome
4
4
 
5
- # Returns true for a palindrome, false otherwise.
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
6
13
 
7
- def palindrome?
8
- processed_content == processed_content.reverse
9
- end
14
+ private
10
15
 
11
- private
16
+ # Returns content for palindrome testing.
17
+ def processed_content
18
+ self.to_s.scan(/[a-z0-9]/i).join.downcase
19
+ end
20
+ end
12
21
 
13
- # Returns content for palindrome testing.
22
+ class String
23
+ include AgiantbirdPalindrome
24
+ end
14
25
 
15
- def processed_content
16
- self.scan(/[a-z]/i).join.downcase
17
- end
26
+ class Integer
27
+ include AgiantbirdPalindrome
18
28
  end
@@ -1,3 +1,3 @@
1
1
  module AgiantbirdPalindrome
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: agiantbird_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
  - Rich Hoyt