numerolog 0.0.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 +7 -0
- data/lib/numerolog.rb +27 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e6bb0241fc9a6618f907bf8d6c334ceec37b6310
|
|
4
|
+
data.tar.gz: c64fd204e312313dd7d5901dd6679a2c3d71b3fa
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 98fc2c596d824f4a048c423d0ee69853603bea409b5ac247bacce692d182bd58c1dee6b69fe26765797508a8a2bb577b34f0bb080d21f88877ee8800d53d6e35
|
|
7
|
+
data.tar.gz: 971c5930244e55c90ba51ed61a78bc0530c36f5c4db8cf0b83240149b7a1812e247fd65614887b75a14e5be910b7b34097c064af8f7918d111e1dd8ac8db4668
|
data/lib/numerolog.rb
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
NUMEROLOGY = { A: 1, J: 1, S: 1, B: 2, K: 2, T: 2, C: 3, L: 3, U: 3, D: 4, M: 4, V:4, E: 5, N: 5, W: 5, F: 6, O: 6, X: 6, G: 7, P: 7, Y: 7, H: 8, Q: 8, Z:8, I: 9, R: 9}
|
|
2
|
+
class String
|
|
3
|
+
# brings numerical sum of all characters based on their position (numerology)
|
|
4
|
+
attr_accessor :sum
|
|
5
|
+
def numerolog
|
|
6
|
+
@sum = 0
|
|
7
|
+
self.each_char do |c|
|
|
8
|
+
if c.upcase! =~ /[[:alpha:]]/
|
|
9
|
+
@sum += NUMEROLOGY[c.to_sym]
|
|
10
|
+
elsif c =~ /[[:digit:]]/
|
|
11
|
+
@sum += c.to_i
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
sum_digits
|
|
15
|
+
return @sum
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def numerolog!
|
|
19
|
+
replace numerolog
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def sum_digits
|
|
23
|
+
until @sum < 10
|
|
24
|
+
@sum = @sum.to_s.split('').map(&:to_i).reduce(&:+)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: numerolog
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Manohar Amrutkar
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: 'Numerology Science: Get your birthday numbers, lucky/destiny numbers,
|
|
14
|
+
Turn any words/string to numbers to find out your lucky nos.'
|
|
15
|
+
email: amrutkar.manohar@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/numerolog.rb
|
|
21
|
+
homepage: http://rubygems.org/gems/numerolog
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - '>='
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - '>='
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubyforge_project:
|
|
41
|
+
rubygems_version: 2.1.3
|
|
42
|
+
signing_key:
|
|
43
|
+
specification_version: 4
|
|
44
|
+
summary: Numerolog
|
|
45
|
+
test_files: []
|