blessing_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: bf2943818ac26922a253b44a15193235f5b8cbb0cdc01dae66ef462ba0478095
4
- data.tar.gz: 518aa1aec3770877541f0d08c5854ce53f2513b9614f76055cf2fca7d1cbf4ff
3
+ metadata.gz: 7c71f073b0ae025827394e93c75af7ef8defd28f0af6c425acce73fc2d3ce547
4
+ data.tar.gz: fb2f966b5d7163a703d99785eeb16ec3492e9b72c681cc519baf5233b9444089
5
5
  SHA512:
6
- metadata.gz: 4ec8574d85d531b190649cd445c6c15d8ab4db567cfe3a5fee689f26f158910325ddd9cd8550c87f55b40c9618c6e81a0e50f7df00d64d82a2db3d31e09a878d
7
- data.tar.gz: d56ff9a858f1dc280a0ef5b12b580dd1ab90b455084f4ffd5a391856368c3e8beadf6e76aacf019907e68b8314ec6f3801214797649dfcb82636d58b323067e2
6
+ metadata.gz: 87848525d15293c3b9408c2b4e7e7b360ca25a95e91f7a1e9ffa88b4689d1868c6f6f617a264b96ac1618e94d26782f9b45921761ee1809c321555ffdcde272a
7
+ data.tar.gz: b11660f19df4f7cd02119e4f00510fdc35dbba267a28638d06d1a83e3961f3ca6922229ab177960982cc6e09276d947863971beaa3fc185d71b92677c7c351c3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blessing_palindrome (0.1.0)
4
+ blessing_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlessingPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,25 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "blessing_palindrome/version"
4
-
5
- class String
6
-
4
+ module BlessingPalindrome
7
5
  # Returns true for a palindrome, false otherwise.
8
6
  def palindrome?
9
- processed_content == processed_content.reverse
7
+ processed_content == processed_content.reverse
10
8
  end
11
9
 
12
- # Returns the letters in the String.
13
- # def letters
14
- # self.chars.select { |c| c.match(/[a-z]/i)}.join
15
- # end
16
-
10
+ # Returns the letters in the String.
11
+ # def letters
12
+ # self.chars.select { |c| c.match(/[a-z]/i)}.join
13
+ # end
14
+
17
15
  private
18
16
 
19
- #Returns content for palindrome testing.
20
- def processed_content
21
- self.scan(/[a-z]/i).join.downcase
22
- end
23
-
24
-
17
+ #Returns content for palindrome testing.
18
+ def processed_content
19
+ self.to_s.scan(/[a-z\d]/i).join.downcase
20
+ end
21
+
22
+ end
23
+
24
+ class String
25
+ include BlessingPalindrome
26
+ end
27
+
28
+ class Integer
29
+ include BlessingPalindrome
25
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blessing_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
  - blessja