bt_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: b4d5154460a750887834c7e9c1c2ffcb70debbaca1a0390afaf60743c9e662ea
4
- data.tar.gz: 3153ab64f222cdab0b2bfc72c4431e6891a342e2f2389f91503ab8695585a404
3
+ metadata.gz: 27b03848dfa29b1292473d0da5219adc239b6d560bce5631ba9511b4ee12a5b2
4
+ data.tar.gz: b99732faba7687d7e9e0a05f5f64d104e6f509ed6a0fe0dac53e6f1767569232
5
5
  SHA512:
6
- metadata.gz: 615a3430b5014229ebb9d051a9524e61b6c69906de2e4313ff8309f0dbbba95225ef8b68cb96ee503cf51aea523f8862bacf2a46246a2eda9715d963d1a91422
7
- data.tar.gz: 12e194286ec0bf3bef1a60033e39e6f678ef7b301840f02afb83d01a235c7d25f662335f8773cbfb8b7a354b4b733e35abba718b676d079c69f85fbec4a92c33
6
+ metadata.gz: 1b8427b15d0023b5b427ed7c8f8438950483ae32d072091bdfb90325ab85584767a7e2e5bee378262e05dab94ab7b6b94d4fb52c1dbd8a6a4f1dd96867f398cd
7
+ data.tar.gz: 403af6a74d0b89aebe2d6f423913c572752877c175f0dff80db964b5e4fe1ba17b7b30b85da743913a88316d15adf5682c968d2da4873ea22898ba4408645c57
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bt_palindrome (0.1.0)
4
+ bt_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 BtPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/bt_palindrome.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  require_relative "bt_palindrome/version"
4
4
 
5
- # Extend String to have a palindrome function
6
- class String
5
+ # Contains functionality to detect palindromes
6
+ module Palindrome
7
7
  def palindrome?
8
8
  processed_string == processed_string.reverse
9
9
  end
@@ -11,6 +11,16 @@ class String
11
11
  private
12
12
 
13
13
  def processed_string
14
- downcase.split(/\W/).join
14
+ to_s.downcase.split(/\W/).join
15
15
  end
16
16
  end
17
+
18
+ # Extend String to have a palindrome function
19
+ class String
20
+ include Palindrome
21
+ end
22
+
23
+ # Extend Integer to have a palindrome function
24
+ class Integer
25
+ include Palindrome
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bt_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
  - Bilal Tariq