Module: ZODIAC

Defined in:
lib/meiou/astronomy.rb

Class Method Summary collapse

Class Method Details

.[](k) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/meiou/astronomy.rb', line 67

def self.[] k
  d = Meiou.date(k)
  month = d.month
  day = d.day
  
  if month == 12
    if day < 22 
      astro_sign = "Sagittarius"; 
    else
      astro_sign ="capricorn"; 
    end

  elsif month == 1
    if day < 20 
      astro_sign = "Capricorn"; 
    else
      astro_sign = "aquarius"; 
    end
  
  elsif month == 2
    if day < 19 
      astro_sign = "Aquarius"; 
    else
      astro_sign = "pisces"; 
    end
  
  elsif month == 3
    if day < 21
      astro_sign = "Pisces"; 
    else
      astro_sign = "aries"; 
    end
  
  elsif month == 4
    if day < 20 
      astro_sign = "Aries"; 
    else
      astro_sign = "taurus"; 
    end
    
  elsif month == 5
    if day < 21 
      astro_sign = "Taurus"; 
    else
      astro_sign = "gemini"; 
    end
    
  elsif month == 6 
    if day < 21 
      astro_sign = "Gemini"; 
    else
      astro_sign = "cancer"; 
    end
    
  elsif month == 7 
    if day < 23 
      astro_sign = "Cancer"; 
    else
      astro_sign = "leo"; 
    end
    
  elsif month == 8
    if day < 23  
      astro_sign = "Leo"; 
    else
      astro_sign = "virgo"; 
    end
    
  elsif month == 9 
    if day < 23
      astro_sign = "Virgo"; 
    else
      astro_sign = "libra"; 
    end
    
  elsif month == 10
    if day < 23 
      astro_sign = "Libra"; 
    else
      astro_sign = "scorpio";  
    end
    
  elsif month == 11 
    if day < 22 
      astro_sign = "scorpio"; 
    else
      astro_sign = "sagittarius"; 
    end
  end
  return { sign: astro_sign, wiki: WIKIPEDIA["#{astro_sign.capitalize} (astrology)"] }
end