brangor_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: 93a2390cc521fbf52d7e3c6da8ff930b47d62498a630add7c67ac9f11f158168
4
- data.tar.gz: f523e9da1029cfa7b4f54a7a4ce98d1eb2db654bb3528409c5de8f7f4bde6dbd
3
+ metadata.gz: c84ab89655df5300bf35aa788a43c1f626c3d236b6b30496e84d8d9099a05d54
4
+ data.tar.gz: c52bdea649f93d34a193f2727c36427bb8e2d5aacd62a5f0f30b05e323ee70a3
5
5
  SHA512:
6
- metadata.gz: 50b166da3315b593c241f49c47444cf2b1cccf8b7c984df7797896338780d7affd58dc96c7a80e469908095403b1d83892774579d156b3af75997884b85b0613
7
- data.tar.gz: 0b91669c0dfe25c9ad98167cae4b842d284edd1b9f3356e5f8b399193ea0de7182b9699e5c74c3f3cc1ab50cb891acd3ec13f7c24840cb13ab7dde2d599fbbbc
6
+ metadata.gz: 5c875fd50902b7a57e6018ecfdf4cc9042b4a9241d10832c60cb4855d13d7d776179cda57cb63a119ac138ea1a0b17c7c40000224ab060ddf61a7d59430211f8
7
+ data.tar.gz: edeee409a2ac37a2632436a0158e4561ce0bfeea1e100b469e9d6faf19930993221acaa604ae59300818ca12549c5a0c1cd92acdda0aacc639135c4a744995ed
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brangor_palindrome (0.1.0)
4
+ brangor_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,21 +1,25 @@
1
1
  require "brangor_palindrome/version"
2
2
 
3
- class String
3
+ module BrangorPalindrome
4
4
 
5
5
  # Returns true for a palindrome, false otherwise.
6
6
  def palindrome?
7
7
  processed_content == processed_content.reverse
8
8
  end
9
9
 
10
- def letters
11
- self.gsub(/[^a-zA-Z]/,"")
12
- end
13
-
14
10
  private
15
11
 
16
12
  # Returns content for palindrome testing
17
13
  def processed_content
18
- self.downcase.letters
14
+ to_s.downcase.gsub(/[^a-z0-9]/,"")
19
15
  end
20
16
 
21
17
  end
18
+
19
+ class String
20
+ include BrangorPalindrome
21
+ end
22
+
23
+ class Integer
24
+ include BrangorPalindrome
25
+ end
@@ -1,3 +1,3 @@
1
1
  module BrangorPalindrome
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: brangor_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
  - Brangor