Class: Rumanu::Numerology
- Inherits:
-
Object
- Object
- Rumanu::Numerology
- Includes:
- Rumanu
- Defined in:
- lib/rumanu/numerology.rb
Constant Summary
Constants included from Rumanu
PY_CONSONANTS, PY_VOWELS, VERSION
Instance Attribute Summary collapse
-
#alphabet ⇒ Object
readonly
Returns the value of attribute alphabet.
-
#consonants ⇒ Object
Returns the value of attribute consonants.
-
#dob ⇒ Object
Returns the value of attribute dob.
-
#vowels ⇒ Object
Returns the value of attribute vowels.
Instance Method Summary collapse
- #destiny ⇒ Object
-
#expression ⇒ Object
Sum of all name’s characters.
-
#initialize(name = "Vance Louis Wheeler", dob = "03/08/1944") ⇒ Numerology
constructor
A new instance of Numerology.
-
#motivation ⇒ Object
Sum of all name’s vowels.
- #name ⇒ Object
- #name=(name) ⇒ Object
-
#personality ⇒ Object
Sum of all name’s consonants.
Methods included from Rumanu
#digit_sum, #reduce_list, #valid_date?, #valid_hash?
Constructor Details
#initialize(name = "Vance Louis Wheeler", dob = "03/08/1944") ⇒ Numerology
Returns a new instance of Numerology.
6 7 8 9 10 11 12 |
# File 'lib/rumanu/numerology.rb', line 6 def initialize(name="Vance Louis Wheeler",dob="03/08/1944") @vowels = PY_VOWELS @consonants = PY_CONSONANTS @alphabet = @vowels.merge @consonants @name = name @dob = dob end |
Instance Attribute Details
#alphabet ⇒ Object (readonly)
Returns the value of attribute alphabet.
4 5 6 |
# File 'lib/rumanu/numerology.rb', line 4 def alphabet @alphabet end |
#consonants ⇒ Object
Returns the value of attribute consonants.
4 5 6 |
# File 'lib/rumanu/numerology.rb', line 4 def consonants @consonants end |
#dob ⇒ Object
Returns the value of attribute dob.
4 5 6 |
# File 'lib/rumanu/numerology.rb', line 4 def dob @dob end |
#vowels ⇒ Object
Returns the value of attribute vowels.
4 5 6 |
# File 'lib/rumanu/numerology.rb', line 4 def vowels @vowels end |
Instance Method Details
#destiny ⇒ Object
44 45 46 47 48 49 |
# File 'lib/rumanu/numerology.rb', line 44 def destiny r = dob.split(/\.|-|\//).inject(0) {|sum,element| sum+element.to_i} value = digit_sum(r) return value unless value.to_s.length >1 digit_sum(value) end |
#expression ⇒ Object
Sum of all name’s characters
62 63 64 |
# File 'lib/rumanu/numerology.rb', line 62 def expression reduce_list(prep_name, @alphabet) end |
#motivation ⇒ Object
Sum of all name’s vowels
52 53 54 |
# File 'lib/rumanu/numerology.rb', line 52 def motivation reduce_list(prep_name, @vowels) end |
#name ⇒ Object
20 21 22 |
# File 'lib/rumanu/numerology.rb', line 20 def name @name.split.map(&:capitalize).join(' ').dup end |
#name=(name) ⇒ Object
14 15 16 17 18 |
# File 'lib/rumanu/numerology.rb', line 14 def name=(name) validate_name(name) @name = name end |
#personality ⇒ Object
Sum of all name’s consonants
57 58 59 |
# File 'lib/rumanu/numerology.rb', line 57 def personality reduce_list(prep_name, @consonants) end |