michelbaas_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: 89d740923092a62e421ac558fa08c3bd538977974091071f3216d958ae3d4b46
4
- data.tar.gz: b03c2089a352bd0b9dbe16a1e4dbd2f9051cd23ef37129ba06dd74d848b9ed06
3
+ metadata.gz: 6ab6bde5c39773010c0bbfb80e3bb9cd2a5b24359ff6a062627e7bc2c71be457
4
+ data.tar.gz: dcac12274878a55951adf7b756723609fd3606c961370f36bcbddec209ace486
5
5
  SHA512:
6
- metadata.gz: 06c37b872db8bacc40513a01225c2b68b4dda88938f369cfc5be0b2f13fe54d9b9ea88e1fd8c86799a769f0eecb557f0742aaa346881bc605c1a379ab7feba43
7
- data.tar.gz: 04ab4140a312883ae6127584ef289764a4d7868e1737183764a91417197bd872385c2d0a030005b918c414f26594b37d33e889f3e8bdf987ab2312484667736d
6
+ metadata.gz: d240b5b47665db9da020984effa41bb9f6aa0c3d1a735be852f8c89cfc9491cf6a72c807c281d145160873354a812c79004c756cd7c0046e5d5e86c3014bde80
7
+ data.tar.gz: 06b3da6a18974ac9541c6cba7a033782a8878696189a80a453d17f32cc179ab3c4cb1ef963853f45e12e20146c08c44a71fd4a815591da08c24ffbe026cbf304
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- michelbaas_palindrome (0.1.0)
4
+ michelbaas_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,21 +1,24 @@
1
1
  require "michelbaas_palindrome/version"
2
2
 
3
- class String
3
+ module MichelBaasPalindrome
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
- # # Returns the letters in the string.
11
- # def letters
12
- # self.chars.select { |c| c.match(/[a-z]/i) }.join
13
- # end
14
-
15
10
  private
16
11
 
17
12
  # Returns content for palindrome testing.
18
13
  def processed_content
19
- downcase.scan(/[a-z]/i).join
14
+ to_s.scan(/[a-z]/i).join.downcase
20
15
  end
21
16
  end
17
+
18
+ class String
19
+ include MichelBaasPalindrome
20
+ end
21
+
22
+ class Integer
23
+ include MichelBaasPalindrome
24
+ end
@@ -1,3 +1,3 @@
1
1
  module MichelbaasPalindrome
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: michelbaas_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
  - Michel Baas