Module: ASTRO
- Defined in:
- lib/meiou/astronomy.rb
Constant Summary collapse
- @@ASTRO =
Astronomy::Information.new
- @@C =
Hash.new { |h,k| h[k] = @@ASTRO.topics(k) }
Class Method Summary collapse
- .[](k) ⇒ Object
- .alignments ⇒ Object
- .init! ⇒ Object
- .keys ⇒ Object
-
.movements ⇒ Object
def self.zodiac [ :cancer,:leo,:capricorn,:gemini,:aquarius,:libra,:taurus,:aries,:pisces ] end.
- .orbits ⇒ Object
- .planets ⇒ Object
- .search(k) ⇒ Object
- .signs ⇒ Object
- .to_a ⇒ Object
- .to_h ⇒ Object
- .to_s ⇒ Object
Class Method Details
.[](k) ⇒ Object
15 16 17 |
# File 'lib/meiou/astronomy.rb', line 15 def self.[] k @@C[k] end |
.alignments ⇒ Object
53 54 55 |
# File 'lib/meiou/astronomy.rb', line 53 def self.alignments [:parallel,:tangential,:perpendicular] end |
.init! ⇒ Object
59 60 61 |
# File 'lib/meiou/astronomy.rb', line 59 def self.init! File.open("books/astronomy_fortune-tellers.txt",'w') { |f| f.write(ASTRO.to_s) } end |
.keys ⇒ Object
19 20 21 |
# File 'lib/meiou/astronomy.rb', line 19 def self.keys @@C.keys end |
.movements ⇒ Object
def self.zodiac
[ :cancer,:leo,:capricorn,:gemini,:aquarius,:libra,:taurus,:aries,:pisces ]
end
44 45 46 |
# File 'lib/meiou/astronomy.rb', line 44 def self.movements [ :rising, :falling, 'at rest' ] end |
.orbits ⇒ Object
50 51 52 |
# File 'lib/meiou/astronomy.rb', line 50 def self.orbits [ "in retrograde", "in procession", "at equinox", "at perogy", "at apogy" ] end |
.planets ⇒ Object
56 57 58 |
# File 'lib/meiou/astronomy.rb', line 56 def self.planets [:mercury,:venus,:mars,:vesta,:ceres,:jupiter,:saturn,:uranus,:neptune,:pluto] end |
.search(k) ⇒ Object
7 8 9 10 11 |
# File 'lib/meiou/astronomy.rb', line 7 def self.search k h = {} @@ASTRO.search(k).each { |e| h[e["name"]] = e["description"] } return h end |
.signs ⇒ Object
47 48 49 |
# File 'lib/meiou/astronomy.rb', line 47 def self.signs [ :sun, :moon ] end |
.to_a ⇒ Object
29 30 31 32 33 |
# File 'lib/meiou/astronomy.rb', line 29 def self.to_a a = [] ASTRO.to_h.each_pair { |k,v| v.each_pair { |kk,vv| a << vv } } return a end |