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

Class Method Details

.[](k) ⇒ Object



15
16
17
# File 'lib/meiou/astronomy.rb', line 15

def self.[] k
  @@C[k]
end

.alignmentsObject



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.txt",'w') { |f| f.write(ASTRO.to_s) }
end

.keysObject



19
20
21
# File 'lib/meiou/astronomy.rb', line 19

def self.keys
  @@C.keys
end

.movementsObject

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

.orbitsObject



50
51
52
# File 'lib/meiou/astronomy.rb', line 50

def self.orbits
  [ "in retrograde", "in procession", "at equinox", "at perogy", "at apogy" ]
end

.planetsObject



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

.signsObject



47
48
49
# File 'lib/meiou/astronomy.rb', line 47

def self.signs
  [ :sun, :moon ]
end

.to_aObject



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

.to_hObject



23
24
25
26
27
# File 'lib/meiou/astronomy.rb', line 23

def self.to_h
  h = Hash.new { |h,k| h[k] = {} }
  ASTRO.keys.each { |e| ASTRO[e].each { |ee| h[e][ee['name']] =  ee["description"] } }
  return h
end

.to_sObject



35
36
37
# File 'lib/meiou/astronomy.rb', line 35

def self.to_s
  ASTRO.to_a.join("\n\n")
end