Module: USNO::Transit::Bodies

Defined in:
lib/usno/transit/bodies.rb

Class Method Summary collapse

Class Method Details

.fetch(k) ⇒ Object



4
5
6
7
8
# File 'lib/usno/transit/bodies.rb', line 4

def self.fetch(k)
  self.hash.fetch(k) {
    raise "Celestial object not recognized - #{k} not found in #{self.hash.keys.join(', ')}"
  }
end

.hashObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/usno/transit/bodies.rb', line 11

def self.hash
	{
	  "Sun"       =>  10, "Moon"           =>  11, "Mercury"   =>  1,
	  "Venus"     =>   2,"Jupiter"         =>   5, "Mars"      =>  4,
	  "Saturn"    =>   6, "Uranus"         =>   7, "Neptune"   =>  8,
	  "Pluto"     =>   9, "Achernar"       =>  -1, "Adhara"    =>  -2,
	  "Aldebaran" =>  -3, "Altair"         =>  -4, "Antares"   =>  -5,
	  "Arcturus"  =>  -6, "Betelgeuse"     =>  -7, "Canopus"   =>  -8,
	  "Capella"   =>  -9, "Deneb"          => -10, "Fomalhaut" => -11,
	  "Hadar"     => -12, "Mimosa"         => -13, "Polaris"   => -14,
	  "Pollux"    => -15, "Procyon"        => -16, "Regulus"   => -17,
	  "Rigel"     => -18, "RigilKentaurus" => -19, "Vega"      => -22,
	  "Sirius"    => -20, "Spica"          => -21,
  }
end