edgar_palindrome 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e6b2e159f922efe2a6f94233d7ce1014cab9a0e9e4d2e9e4e58a486a77f7866
4
- data.tar.gz: '09a694f7791387f612dbe572c77dc5e3a554f0004e07ae3f8d3caafac278b79e'
3
+ metadata.gz: 3ddbb8d190136ea3d17de37bc5729121e7fb656d3fe2fd47c670f79210bae428
4
+ data.tar.gz: 3f7b2b6f7f99988088447f400ace2061044247508850fc20dccddd15682c110b
5
5
  SHA512:
6
- metadata.gz: 5ba352be3e0f9f595e6fb2a1af6537c3ddeaceba48745fe3d27ef868abdc1f60df9a7914ef43817bd6c07ecd1c5e386b57efab23a300b45399181ef5e3cf3ceb
7
- data.tar.gz: '08d99ff7fcf37fba2603be69e1a7de510b017d1fee55d1489851a3b367136b3b80e391da5d693b5b8a6d6390543227f33c854aa5ea4849d31fc596b1a62b9220'
6
+ metadata.gz: 3d771828ab5d0ccb8296c7f96bec095cde81b437b9a46f55fcc87664fb66182f576294e06a87be9d6f5916e4a2e98233f678983da1c500e03687643249f718b7
7
+ data.tar.gz: 3861d601bcaa98912b978a91e6b5ca268ea4789094afa4eceb2c372061147746f0b6b96538c187b1ba2f99cd1fa55ffc8cce787e10aa6c8460c4b919cb61df90
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EdgarPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  require "edgar_palindrome/version"
2
2
 
3
- class String
3
+ module EdgarPalindrome
4
4
 
5
5
  # Returns true for a palindrome, false otherwise.
6
6
  def palindrome?
@@ -8,13 +8,22 @@ class String
8
8
  end
9
9
 
10
10
  def letters
11
- self.scan(/[a-zA-Z]/).join
11
+ self.scan(/[a-zA-Z\d]/).join
12
12
  end
13
13
 
14
14
  private
15
15
 
16
16
  # Returns content for palindrome testing.
17
17
  def processed_content
18
- self.downcase.letters
18
+ self.to_s.downcase.letters
19
19
  end
20
20
  end
21
+
22
+ class String
23
+ include EdgarPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include EdgarPalindrome
28
+ end
29
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edgar_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
  - Edgar Markevicius