hebrew_date 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: HebrewDateSupport
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (H)</a> &raquo;
35
+
36
+
37
+ <span class="title">HebrewDateSupport</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: HebrewDateSupport
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/support/holidays.rb<span class="defines">,<br />
83
+ lib/support/parshiot.rb</span>
84
+ </dd>
85
+
86
+ </dl>
87
+ <div class="clear"></div>
88
+
89
+ <h2>Defined Under Namespace</h2>
90
+ <p class="children">
91
+
92
+
93
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="HebrewDateSupport/Holidays.html" title="HebrewDateSupport::Holidays (module)">Holidays</a></span>, <span class='object_link'><a href="HebrewDateSupport/Parshiot.html" title="HebrewDateSupport::Parshiot (module)">Parshiot</a></span>
94
+
95
+
96
+
97
+
98
+ </p>
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ </div>
109
+
110
+ <div id="footer">
111
+ Generated on Thu Jan 16 19:44:44 2014 by
112
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
113
+ 0.8.7.3 (ruby-2.0.0).
114
+ </div>
115
+
116
+ </body>
117
+ </html>
@@ -0,0 +1,1110 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: HebrewDateSupport::Holidays
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (H)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../HebrewDateSupport.html" title="HebrewDateSupport (module)">HebrewDateSupport</a></span></span>
36
+ &raquo;
37
+ <span class="title">Holidays</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: HebrewDateSupport::Holidays
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+ <dt class="r1">Included in:</dt>
81
+ <dd class="r1"><span class='object_link'><a href="../HebrewDate.html" title="HebrewDate (class)">HebrewDate</a></span></dd>
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/support/holidays.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <h2>
100
+ Instance Method Summary
101
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
102
+ </h2>
103
+
104
+ <ul class="summary">
105
+
106
+ <li class="public ">
107
+ <span class="summary_signature">
108
+
109
+ <a href="#candle_lighting_day%3F-instance_method" title="#candle_lighting_day? (instance method)">- (Boolean) <strong>candle_lighting_day?</strong> </a>
110
+
111
+
112
+
113
+ </span>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <span class="summary_desc"><div class='inline'>
124
+ <p>Whether there is candle lighting today, i.e.it is either Friday, Erev Yom
125
+ Tov, or 1st day yom tov when there is a second day.</p>
126
+ </div></span>
127
+
128
+ </li>
129
+
130
+
131
+ <li class="public ">
132
+ <span class="summary_signature">
133
+
134
+ <a href="#first_day_yom_tov%3F-instance_method" title="#first_day_yom_tov? (instance method)">- (Boolean) <strong>first_day_yom_tov?</strong> </a>
135
+
136
+
137
+
138
+ </span>
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+ <span class="summary_desc"><div class='inline'>
149
+ <p>Is this day a first day of Yom Tov? Only should return true if there is a
150
+ second day.</p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ <li class="public ">
157
+ <span class="summary_signature">
158
+
159
+ <a href="#havdala_day%3F-instance_method" title="#havdala_day? (instance method)">- (Boolean) <strong>havdala_day?</strong> </a>
160
+
161
+
162
+
163
+ </span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'>
174
+ <p>Whether there is Havdala today.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ <li class="public ">
181
+ <span class="summary_signature">
182
+
183
+ <a href="#holiday-instance_method" title="#holiday (instance method)">- (String) <strong>holiday</strong>(generic = false) </a>
184
+
185
+
186
+
187
+ </span>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'>
198
+ <p>Returns a string of the Jewish holiday or fast day for the current day, or
199
+ an empty string if there is no holiday for this day.</p>
200
+ </div></span>
201
+
202
+ </li>
203
+
204
+
205
+ <li class="public ">
206
+ <span class="summary_signature">
207
+
208
+ <a href="#omer-instance_method" title="#omer (instance method)">- (Integer) <strong>omer</strong> </a>
209
+
210
+
211
+
212
+ </span>
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+ <span class="summary_desc"><div class='inline'>
223
+ <p>Get the number of the Omer for this day, or nil if there isn&#39;t one.</p>
224
+ </div></span>
225
+
226
+ </li>
227
+
228
+
229
+ <li class="public ">
230
+ <span class="summary_signature">
231
+
232
+ <a href="#omer_to_s-instance_method" title="#omer_to_s (instance method)">- (String) <strong>omer_to_s</strong> </a>
233
+
234
+
235
+
236
+ </span>
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+ <span class="summary_desc"><div class='inline'>
247
+ <p>Returns the omer day in the form “Omer X” or “Lag B&#39;Omer” or an empty
248
+ string if there is no omer this day.</p>
249
+ </div></span>
250
+
251
+ </li>
252
+
253
+
254
+ <li class="public ">
255
+ <span class="summary_signature">
256
+
257
+ <a href="#rosh_chodesh%3F-instance_method" title="#rosh_chodesh? (instance method)">- (Boolean) <strong>rosh_chodesh?</strong> </a>
258
+
259
+
260
+
261
+ </span>
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+ <span class="summary_desc"><div class='inline'>
272
+ <p>Is this date Rosh Chodesh?.</p>
273
+ </div></span>
274
+
275
+ </li>
276
+
277
+
278
+ </ul>
279
+
280
+
281
+
282
+
283
+ <div id="instance_method_details" class="method_details_list">
284
+ <h2>Instance Method Details</h2>
285
+
286
+
287
+ <div class="method_details first">
288
+ <h3 class="signature first" id="candle_lighting_day?-instance_method">
289
+
290
+ - (<tt>Boolean</tt>) <strong>candle_lighting_day?</strong>
291
+
292
+
293
+
294
+
295
+
296
+ </h3><div class="docstring">
297
+ <div class="discussion">
298
+
299
+ <p>Whether there is candle lighting today, i.e.it is either Friday, Erev Yom
300
+ Tov, or 1st day yom tov when there is a second day.</p>
301
+
302
+
303
+ </div>
304
+ </div>
305
+ <div class="tags">
306
+
307
+ <p class="tag_title">Returns:</p>
308
+ <ul class="return">
309
+
310
+ <li>
311
+
312
+
313
+ <span class='type'>(<tt>Boolean</tt>)</span>
314
+
315
+
316
+
317
+ </li>
318
+
319
+ </ul>
320
+
321
+ </div><table class="source_code">
322
+ <tr>
323
+ <td>
324
+ <pre class="lines">
325
+
326
+
327
+ 187
328
+ 188
329
+ 189
330
+ 190
331
+ 191
332
+ 192
333
+ 193
334
+ 194
335
+ 195
336
+ 196
337
+ 197
338
+ 198
339
+ 199
340
+ 200
341
+ 201
342
+ 202
343
+ 203
344
+ 204
345
+ 205</pre>
346
+ </td>
347
+ <td>
348
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 187</span>
349
+
350
+ <span class='kw'>def</span> <span class='id identifier rubyid_candle_lighting_day?'>candle_lighting_day?</span>
351
+ <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>6</span>
352
+ <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_day_yom_tov?'>first_day_yom_tov?</span>
353
+ <span class='kw'>case</span> <span class='ivar'>@hebrew_month</span>
354
+ <span class='kw'>when</span> <span class='int'>6</span>
355
+ <span class='comment'># Erev Rosh Hashana
356
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>29</span>
357
+ <span class='kw'>when</span> <span class='int'>7</span>
358
+ <span class='comment'># Erev Yom Kippur, Erev Sukkos, Erev Shmini Atzeres
359
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>9</span><span class='comma'>,</span> <span class='int'>14</span><span class='comma'>,</span> <span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
360
+ <span class='kw'>when</span> <span class='int'>1</span>
361
+ <span class='comment'># Erev Pesach or Erev 7th day Pesach
362
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>14</span><span class='comma'>,</span> <span class='int'>20</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
363
+ <span class='kw'>when</span> <span class='int'>3</span>
364
+ <span class='comment'># Erev Shavuos
365
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>5</span>
366
+ <span class='kw'>end</span>
367
+ <span class='kw'>false</span>
368
+ <span class='kw'>end</span></pre>
369
+ </td>
370
+ </tr>
371
+ </table>
372
+ </div>
373
+
374
+ <div class="method_details ">
375
+ <h3 class="signature " id="first_day_yom_tov?-instance_method">
376
+
377
+ - (<tt>Boolean</tt>) <strong>first_day_yom_tov?</strong>
378
+
379
+
380
+
381
+
382
+
383
+ </h3><div class="docstring">
384
+ <div class="discussion">
385
+
386
+ <p>Is this day a first day of Yom Tov? Only should return true if there is a
387
+ second day.</p>
388
+
389
+
390
+ </div>
391
+ </div>
392
+ <div class="tags">
393
+
394
+ <p class="tag_title">Returns:</p>
395
+ <ul class="return">
396
+
397
+ <li>
398
+
399
+
400
+ <span class='type'>(<tt>Boolean</tt>)</span>
401
+
402
+
403
+
404
+ </li>
405
+
406
+ </ul>
407
+
408
+ </div><table class="source_code">
409
+ <tr>
410
+ <td>
411
+ <pre class="lines">
412
+
413
+
414
+ 165
415
+ 166
416
+ 167
417
+ 168
418
+ 169
419
+ 170
420
+ 171
421
+ 172
422
+ 173
423
+ 174
424
+ 175
425
+ 176
426
+ 177
427
+ 178
428
+ 179
429
+ 180
430
+ 181
431
+ 182</pre>
432
+ </td>
433
+ <td>
434
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 165</span>
435
+
436
+ <span class='kw'>def</span> <span class='id identifier rubyid_first_day_yom_tov?'>first_day_yom_tov?</span>
437
+ <span class='comment'># only second day Yom Tov in Israel is Rosh Hashana
438
+ </span> <span class='kw'>if</span> <span class='ivar'>@israeli</span>
439
+ <span class='kw'>return</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>7</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>1</span>
440
+ <span class='kw'>end</span>
441
+ <span class='kw'>case</span> <span class='ivar'>@hebrew_month</span>
442
+ <span class='kw'>when</span> <span class='int'>7</span>
443
+ <span class='comment'># Rosh Hashana, Sukkos, and Shmini Atzeres
444
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>15</span><span class='comma'>,</span> <span class='int'>22</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
445
+ <span class='kw'>when</span> <span class='int'>1</span>
446
+ <span class='comment'># 2nd and last days Pesach
447
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>15</span><span class='comma'>,</span> <span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
448
+ <span class='kw'>when</span> <span class='int'>3</span>
449
+ <span class='comment'># Shavuos
450
+ </span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>6</span>
451
+ <span class='kw'>end</span>
452
+ <span class='kw'>false</span>
453
+ <span class='kw'>end</span></pre>
454
+ </td>
455
+ </tr>
456
+ </table>
457
+ </div>
458
+
459
+ <div class="method_details ">
460
+ <h3 class="signature " id="havdala_day?-instance_method">
461
+
462
+ - (<tt>Boolean</tt>) <strong>havdala_day?</strong>
463
+
464
+
465
+
466
+
467
+
468
+ </h3><div class="docstring">
469
+ <div class="discussion">
470
+
471
+ <p>Whether there is Havdala today. This would be Sat. night (except for a Yom
472
+ Tov night), or Motzei Yom Tov (except for Fri. night).</p>
473
+
474
+
475
+ </div>
476
+ </div>
477
+ <div class="tags">
478
+
479
+ <p class="tag_title">Returns:</p>
480
+ <ul class="return">
481
+
482
+ <li>
483
+
484
+
485
+ <span class='type'>(<tt>Boolean</tt>)</span>
486
+
487
+
488
+
489
+ </li>
490
+
491
+ </ul>
492
+
493
+ </div><table class="source_code">
494
+ <tr>
495
+ <td>
496
+ <pre class="lines">
497
+
498
+
499
+ 210
500
+ 211
501
+ 212
502
+ 213
503
+ 214
504
+ 215
505
+ 216
506
+ 217
507
+ 218
508
+ 219
509
+ 220
510
+ 221
511
+ 222
512
+ 223
513
+ 224
514
+ 225
515
+ 226
516
+ 227
517
+ 228
518
+ 229
519
+ 230
520
+ 231
521
+ 232
522
+ 233
523
+ 234
524
+ 235
525
+ 236
526
+ 237
527
+ 238
528
+ 239
529
+ 240
530
+ 241
531
+ 242
532
+ 243
533
+ 244
534
+ 245
535
+ 246
536
+ 247
537
+ 248
538
+ 249
539
+ 250
540
+ 251
541
+ 252
542
+ 253</pre>
543
+ </td>
544
+ <td>
545
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 210</span>
546
+
547
+ <span class='kw'>def</span> <span class='id identifier rubyid_havdala_day?'>havdala_day?</span>
548
+ <span class='comment'># if today is a candlelighting day, then there is no havdala
549
+ </span> <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_candle_lighting_day?'>candle_lighting_day?</span>
550
+
551
+ <span class='comment'># if today is Sat. night, return true unless it is Yom Tov
552
+ </span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>7</span>
553
+ <span class='kw'>case</span> <span class='ivar'>@hebrew_month</span>
554
+ <span class='kw'>when</span> <span class='int'>7</span>
555
+ <span class='comment'># 1st day Rosh Hashana
556
+ </span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>1</span>
557
+ <span class='kw'>false</span>
558
+ <span class='kw'>else</span>
559
+ <span class='comment'># Sukkos 1 and Shmini Atzeres if outside Israel
560
+ </span> <span class='ivar'>@israeli</span> <span class='op'>||</span> <span class='op'>!</span><span class='lbracket'>[</span><span class='int'>15</span><span class='comma'>,</span> <span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
561
+ <span class='kw'>end</span>
562
+ <span class='kw'>when</span> <span class='int'>1</span>
563
+ <span class='comment'># Pesach 1 or 7
564
+ </span> <span class='ivar'>@israeli</span> <span class='op'>||</span> <span class='op'>!</span><span class='lbracket'>[</span><span class='int'>15</span><span class='comma'>,</span> <span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
565
+ <span class='kw'>when</span> <span class='int'>3</span>
566
+ <span class='comment'># Shavos 1
567
+ </span> <span class='ivar'>@israeli</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>!=</span> <span class='int'>6</span>
568
+ <span class='kw'>else</span>
569
+ <span class='kw'>true</span>
570
+ <span class='kw'>end</span>
571
+ <span class='kw'>else</span>
572
+ <span class='comment'># detect Motzai Yom Tov on non-Sat. night
573
+ </span> <span class='kw'>case</span> <span class='ivar'>@hebrew_month</span>
574
+ <span class='kw'>when</span> <span class='int'>7</span>
575
+ <span class='comment'># Rosh Hashana 2, Yom Kippur, Sukkos, Shmini Atzeres
576
+ </span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span> <span class='int'>10</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span> <span class='op'>||</span>
577
+ <span class='lparen'>(</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='lbracket'>[</span><span class='int'>15</span><span class='comma'>,</span> <span class='int'>22</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>||</span>
578
+ <span class='lparen'>(</span><span class='op'>!</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='lbracket'>[</span><span class='int'>16</span><span class='comma'>,</span> <span class='int'>23</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span><span class='rparen'>)</span>
579
+ <span class='kw'>when</span> <span class='int'>1</span>
580
+ <span class='comment'># Pesach 1/7 or 2/8
581
+ </span> <span class='lparen'>(</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='lbracket'>[</span><span class='int'>15</span><span class='comma'>,</span> <span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>||</span>
582
+ <span class='lparen'>(</span><span class='op'>!</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='lbracket'>[</span><span class='int'>16</span><span class='comma'>,</span> <span class='int'>22</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span><span class='rparen'>)</span>
583
+ <span class='kw'>when</span> <span class='int'>3</span>
584
+ <span class='comment'># Shavuos
585
+ </span> <span class='lparen'>(</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>6</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='op'>!</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>7</span><span class='rparen'>)</span>
586
+ <span class='kw'>else</span>
587
+ <span class='kw'>false</span>
588
+ <span class='kw'>end</span>
589
+ <span class='kw'>end</span>
590
+ <span class='kw'>end</span></pre>
591
+ </td>
592
+ </tr>
593
+ </table>
594
+ </div>
595
+
596
+ <div class="method_details ">
597
+ <h3 class="signature " id="holiday-instance_method">
598
+
599
+ - (<tt>String</tt>) <strong>holiday</strong>(generic = false)
600
+
601
+
602
+
603
+
604
+
605
+ </h3><div class="docstring">
606
+ <div class="discussion">
607
+
608
+ <p>Returns a string of the Jewish holiday or fast day for the current day, or
609
+ an empty string if there is no holiday for this day. (e.g. “Pesach”) or a
610
+ specific one (e.g. “Chol Hamoed Pesach”).</p>
611
+
612
+
613
+ </div>
614
+ </div>
615
+ <div class="tags">
616
+ <p class="tag_title">Parameters:</p>
617
+ <ul class="param">
618
+
619
+ <li>
620
+
621
+ <span class='name'>generic</span>
622
+
623
+
624
+ <span class='type'>(<tt>Boolean</tt>)</span>
625
+
626
+
627
+ <em class="default">(defaults to: <tt>false</tt>)</em>
628
+
629
+
630
+ &mdash;
631
+ <div class='inline'>
632
+ <p>whether you want just a generic name</p>
633
+ </div>
634
+
635
+ </li>
636
+
637
+ </ul>
638
+
639
+ <p class="tag_title">Returns:</p>
640
+ <ul class="return">
641
+
642
+ <li>
643
+
644
+
645
+ <span class='type'>(<tt>String</tt>)</span>
646
+
647
+
648
+
649
+ </li>
650
+
651
+ </ul>
652
+
653
+ </div><table class="source_code">
654
+ <tr>
655
+ <td>
656
+ <pre class="lines">
657
+
658
+
659
+ 8
660
+ 9
661
+ 10
662
+ 11
663
+ 12
664
+ 13
665
+ 14
666
+ 15
667
+ 16
668
+ 17
669
+ 18
670
+ 19
671
+ 20
672
+ 21
673
+ 22
674
+ 23
675
+ 24
676
+ 25
677
+ 26
678
+ 27
679
+ 28
680
+ 29
681
+ 30
682
+ 31
683
+ 32
684
+ 33
685
+ 34
686
+ 35
687
+ 36
688
+ 37
689
+ 38
690
+ 39
691
+ 40
692
+ 41
693
+ 42
694
+ 43
695
+ 44
696
+ 45
697
+ 46
698
+ 47
699
+ 48
700
+ 49
701
+ 50
702
+ 51
703
+ 52
704
+ 53
705
+ 54
706
+ 55
707
+ 56
708
+ 57
709
+ 58
710
+ 59
711
+ 60
712
+ 61
713
+ 62
714
+ 63
715
+ 64
716
+ 65
717
+ 66
718
+ 67
719
+ 68
720
+ 69
721
+ 70
722
+ 71
723
+ 72
724
+ 73
725
+ 74
726
+ 75
727
+ 76
728
+ 77
729
+ 78
730
+ 79
731
+ 80
732
+ 81
733
+ 82
734
+ 83
735
+ 84
736
+ 85
737
+ 86
738
+ 87
739
+ 88
740
+ 89
741
+ 90
742
+ 91
743
+ 92
744
+ 93
745
+ 94
746
+ 95
747
+ 96
748
+ 97
749
+ 98
750
+ 99
751
+ 100
752
+ 101
753
+ 102
754
+ 103
755
+ 104
756
+ 105
757
+ 106
758
+ 107
759
+ 108
760
+ 109
761
+ 110
762
+ 111
763
+ 112
764
+ 113
765
+ 114
766
+ 115
767
+ 116
768
+ 117
769
+ 118
770
+ 119
771
+ 120
772
+ 121
773
+ 122
774
+ 123
775
+ 124
776
+ 125
777
+ 126</pre>
778
+ </td>
779
+ <td>
780
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 8</span>
781
+
782
+ <span class='kw'>def</span> <span class='id identifier rubyid_holiday'>holiday</span><span class='lparen'>(</span><span class='id identifier rubyid_generic'>generic</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
783
+
784
+ <span class='comment'># check by month (starts from Nissan)
785
+ </span> <span class='kw'>case</span> <span class='ivar'>@hebrew_month</span>
786
+ <span class='kw'>when</span> <span class='int'>1</span>
787
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Pesach</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>14</span>
788
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>15</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>21</span> <span class='op'>||</span>
789
+ <span class='lparen'>(</span><span class='op'>!</span><span class='ivar'>@israeli</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>16</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>22</span><span class='rparen'>)</span><span class='rparen'>)</span>
790
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Pesach</span><span class='tstring_end'>&#39;</span></span>
791
+ <span class='kw'>end</span>
792
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&gt;=</span> <span class='int'>17</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&lt;=</span> <span class='int'>20</span> <span class='op'>||</span>
793
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>16</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@israeli</span><span class='rparen'>)</span>
794
+ <span class='kw'>return</span> <span class='id identifier rubyid_generic'>generic</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Pesach</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Chol Hamoed Pesach</span><span class='tstring_end'>&#39;</span></span>
795
+ <span class='kw'>end</span>
796
+ <span class='kw'>when</span> <span class='int'>2</span>
797
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Pesach Sheni</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>14</span>
798
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>5</span> <span class='op'>&amp;&amp;</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>3</span><span class='comma'>,</span> <span class='int'>4</span><span class='comma'>,</span> <span class='int'>5</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span>
799
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Yom Ha&#39;atzmaut</span><span class='tstring_end'>&quot;</span></span>
800
+ <span class='kw'>end</span>
801
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Yom Ha&#39;atzmaut</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>6</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>3</span>
802
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Yom Ha&#39;atzmaut</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>3</span><span class='comma'>,</span> <span class='int'>4</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span>
803
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>5</span>
804
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>4</span> <span class='op'>&amp;&amp;</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='comma'>,</span> <span class='int'>4</span><span class='comma'>,</span> <span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span>
805
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Yom Hazikaron</span><span class='tstring_end'>&#39;</span></span>
806
+ <span class='kw'>end</span>
807
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Yom Hazikaron</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>5</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>2</span>
808
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Yom Hazikaron</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span>
809
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>4</span>
810
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Yom Yerushalayim</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>28</span>
811
+ <span class='kw'>when</span> <span class='int'>3</span>
812
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>5</span>
813
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Shavuos</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Shavuot</span><span class='tstring_end'>&#39;</span></span>
814
+ <span class='kw'>end</span>
815
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>6</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>7</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@israeli</span><span class='rparen'>)</span>
816
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shavuos</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shavuot</span><span class='tstring_end'>&#39;</span></span>
817
+ <span class='kw'>end</span>
818
+ <span class='kw'>when</span> <span class='int'>4</span>
819
+ <span class='comment'># push off the fast day if it falls on Shabbos
820
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>17</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>!=</span> <span class='int'>7</span><span class='rparen'>)</span> <span class='op'>||</span>
821
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>18</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>1</span><span class='rparen'>)</span>
822
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Tzom Tammuz</span><span class='tstring_end'>&#39;</span></span>
823
+ <span class='kw'>end</span>
824
+ <span class='kw'>when</span> <span class='int'>5</span>
825
+ <span class='comment'># if Tisha B&#39;Av falls on Shabbos, push off until Sunday
826
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>10</span><span class='rparen'>)</span> <span class='op'>||</span>
827
+ <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>!=</span> <span class='int'>7</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>9</span><span class='rparen'>)</span>
828
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Tisha B&#39;av</span><span class='tstring_end'>&quot;</span></span>
829
+ <span class='kw'>end</span>
830
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Tu B&#39;Av</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>15</span>
831
+ <span class='kw'>when</span> <span class='int'>6</span>
832
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Rosh Hashanah</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>29</span>
833
+ <span class='kw'>when</span> <span class='int'>7</span>
834
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Rosh Hashanah</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
835
+ <span class='comment'># push off Tzom Gedalia if it falls on Shabbos
836
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>3</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>!=</span> <span class='int'>7</span><span class='rparen'>)</span> <span class='op'>||</span>
837
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>4</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>1</span><span class='rparen'>)</span>
838
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Tzom Gedalia</span><span class='tstring_end'>&#39;</span></span>
839
+ <span class='kw'>end</span>
840
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Yom Kippur</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>9</span>
841
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Yom Kippur</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>10</span>
842
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>14</span>
843
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Sukkos</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Sukkot</span><span class='tstring_end'>&#39;</span></span>
844
+ <span class='kw'>end</span>
845
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>15</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>16</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@israeli</span><span class='rparen'>)</span>
846
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Sukkos</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Sukkot</span><span class='tstring_end'>&#39;</span></span>
847
+ <span class='kw'>end</span>
848
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&gt;=</span> <span class='int'>17</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&lt;=</span> <span class='int'>20</span> <span class='op'>||</span>
849
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>16</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@israeli</span><span class='rparen'>)</span>
850
+ <span class='kw'>if</span> <span class='ivar'>@ashkenaz</span>
851
+ <span class='kw'>return</span> <span class='id identifier rubyid_generic'>generic</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Sukkos</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Chol Hamoed Sukkos</span><span class='tstring_end'>&#39;</span></span>
852
+ <span class='kw'>else</span>
853
+ <span class='kw'>return</span> <span class='id identifier rubyid_generic'>generic</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Sukkot</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Chol Hamoed Sukkot</span><span class='tstring_end'>&#39;</span></span>
854
+ <span class='kw'>end</span>
855
+ <span class='kw'>end</span>
856
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Hoshana Rabah</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>21</span>
857
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>22</span>
858
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shmini Atzeres</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shmini Atzeret</span><span class='tstring_end'>&#39;</span></span>
859
+ <span class='kw'>end</span>
860
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>23</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@israeli</span>
861
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Simchas Torah</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Simchat Torah</span><span class='tstring_end'>&#39;</span></span>
862
+ <span class='kw'>end</span>
863
+ <span class='kw'>when</span> <span class='int'>9</span>
864
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Erev Chanukah</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>24</span>
865
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Chanukah</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&gt;=</span> <span class='int'>25</span>
866
+ <span class='kw'>when</span> <span class='int'>10</span>
867
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>2</span> <span class='op'>||</span>
868
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span><span class='int'>3</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid__kislev_short?'>_kislev_short?</span><span class='rparen'>)</span>
869
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Chanukah</span><span class='tstring_end'>&#39;</span></span>
870
+ <span class='kw'>end</span>
871
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>10</span>
872
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Tzom Teves</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Tzom Tevet</span><span class='tstring_end'>&#39;</span></span>
873
+ <span class='kw'>end</span>
874
+ <span class='kw'>when</span> <span class='int'>11</span>
875
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Tu B&#39;Shvat</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>15</span>
876
+ <span class='kw'>when</span> <span class='int'>12</span>
877
+ <span class='kw'>if</span> <span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span>
878
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Purim Katan</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>14</span>
879
+ <span class='kw'>else</span>
880
+ <span class='comment'># if 13th Adar falls on Fri or Shabbos, push back to Thursday
881
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>11</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>12</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>5</span><span class='rparen'>)</span> <span class='op'>||</span>
882
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>13</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='lbracket'>[</span><span class='int'>6</span><span class='comma'>,</span> <span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span><span class='rparen'>)</span>
883
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ta&#39;anis Esther</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ta&#39;anit Esther</span><span class='tstring_end'>&quot;</span></span>
884
+ <span class='kw'>end</span>
885
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Purim</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>14</span>
886
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shushan Purim</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>15</span>
887
+ <span class='kw'>end</span>
888
+ <span class='kw'>when</span> <span class='int'>13</span>
889
+ <span class='comment'># if 13th Adar falls on Fri or Shabbos, push back to Thursday
890
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>11</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>12</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>5</span><span class='rparen'>)</span> <span class='op'>||</span>
891
+ <span class='lparen'>(</span><span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>13</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='lbracket'>[</span><span class='int'>6</span><span class='comma'>,</span> <span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span><span class='rparen'>)</span>
892
+ <span class='kw'>return</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ta&#39;anis Esther</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ta&#39;anit Esther</span><span class='tstring_end'>&quot;</span></span>
893
+ <span class='kw'>end</span>
894
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Purim</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>14</span>
895
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shushan Purim</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>15</span>
896
+ <span class='kw'>else</span>
897
+ <span class='comment'># if we get to this stage, then there are no holidays for the given date
898
+ </span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
899
+ <span class='kw'>end</span>
900
+ <span class='kw'>end</span></pre>
901
+ </td>
902
+ </tr>
903
+ </table>
904
+ </div>
905
+
906
+ <div class="method_details ">
907
+ <h3 class="signature " id="omer-instance_method">
908
+
909
+ - (<tt>Integer</tt>) <strong>omer</strong>
910
+
911
+
912
+
913
+
914
+
915
+ </h3><div class="docstring">
916
+ <div class="discussion">
917
+
918
+ <p>Get the number of the Omer for this day, or nil if there isn&#39;t one.</p>
919
+
920
+
921
+ </div>
922
+ </div>
923
+ <div class="tags">
924
+
925
+ <p class="tag_title">Returns:</p>
926
+ <ul class="return">
927
+
928
+ <li>
929
+
930
+
931
+ <span class='type'>(<tt>Integer</tt>)</span>
932
+
933
+
934
+
935
+ </li>
936
+
937
+ </ul>
938
+
939
+ </div><table class="source_code">
940
+ <tr>
941
+ <td>
942
+ <pre class="lines">
943
+
944
+
945
+ 130
946
+ 131
947
+ 132
948
+ 133
949
+ 134
950
+ 135
951
+ 136
952
+ 137
953
+ 138
954
+ 139
955
+ 140</pre>
956
+ </td>
957
+ <td>
958
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 130</span>
959
+
960
+ <span class='kw'>def</span> <span class='id identifier rubyid_omer'>omer</span>
961
+ <span class='kw'>if</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&gt;=</span> <span class='int'>16</span>
962
+ <span class='comment'># Nissan, second day of Pesach and on
963
+ </span> <span class='ivar'>@hebrew_date</span> <span class='op'>-</span> <span class='int'>15</span>
964
+ <span class='kw'>elsif</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>2</span> <span class='comment'># Iyar
965
+ </span> <span class='ivar'>@hebrew_date</span> <span class='op'>+</span> <span class='int'>15</span>
966
+ <span class='kw'>elsif</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>3</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span> <span class='op'>&lt;</span> <span class='int'>6</span>
967
+ <span class='comment'># Sivan, before Shavuos
968
+ </span> <span class='ivar'>@hebrew_date</span> <span class='op'>+</span> <span class='int'>44</span>
969
+ <span class='kw'>end</span>
970
+ <span class='kw'>end</span></pre>
971
+ </td>
972
+ </tr>
973
+ </table>
974
+ </div>
975
+
976
+ <div class="method_details ">
977
+ <h3 class="signature " id="omer_to_s-instance_method">
978
+
979
+ - (<tt>String</tt>) <strong>omer_to_s</strong>
980
+
981
+
982
+
983
+
984
+
985
+ </h3><div class="docstring">
986
+ <div class="discussion">
987
+
988
+ <p>Returns the omer day in the form “Omer X” or “Lag B&#39;Omer” or an empty
989
+ string if there is no omer this day.</p>
990
+
991
+
992
+ </div>
993
+ </div>
994
+ <div class="tags">
995
+
996
+ <p class="tag_title">Returns:</p>
997
+ <ul class="return">
998
+
999
+ <li>
1000
+
1001
+
1002
+ <span class='type'>(<tt>String</tt>)</span>
1003
+
1004
+
1005
+
1006
+ </li>
1007
+
1008
+ </ul>
1009
+
1010
+ </div><table class="source_code">
1011
+ <tr>
1012
+ <td>
1013
+ <pre class="lines">
1014
+
1015
+
1016
+ 145
1017
+ 146
1018
+ 147
1019
+ 148
1020
+ 149
1021
+ 150
1022
+ 151
1023
+ 152
1024
+ 153
1025
+ 154</pre>
1026
+ </td>
1027
+ <td>
1028
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 145</span>
1029
+
1030
+ <span class='kw'>def</span> <span class='id identifier rubyid_omer_to_s'>omer_to_s</span>
1031
+ <span class='id identifier rubyid_omer'>omer</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_omer'>omer</span>
1032
+ <span class='kw'>if</span> <span class='id identifier rubyid_omer'>omer</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1033
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
1034
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_omer'>omer</span> <span class='op'>==</span> <span class='int'>33</span>
1035
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Lag B&#39;Omer</span><span class='tstring_end'>&quot;</span></span>
1036
+ <span class='kw'>else</span>
1037
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Omer </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_omer'>omer</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
1038
+ <span class='kw'>end</span>
1039
+ <span class='kw'>end</span></pre>
1040
+ </td>
1041
+ </tr>
1042
+ </table>
1043
+ </div>
1044
+
1045
+ <div class="method_details ">
1046
+ <h3 class="signature " id="rosh_chodesh?-instance_method">
1047
+
1048
+ - (<tt>Boolean</tt>) <strong>rosh_chodesh?</strong>
1049
+
1050
+
1051
+
1052
+
1053
+
1054
+ </h3><div class="docstring">
1055
+ <div class="discussion">
1056
+
1057
+ <p>Is this date Rosh Chodesh?</p>
1058
+
1059
+
1060
+ </div>
1061
+ </div>
1062
+ <div class="tags">
1063
+
1064
+ <p class="tag_title">Returns:</p>
1065
+ <ul class="return">
1066
+
1067
+ <li>
1068
+
1069
+
1070
+ <span class='type'>(<tt>Boolean</tt>)</span>
1071
+
1072
+
1073
+
1074
+ </li>
1075
+
1076
+ </ul>
1077
+
1078
+ </div><table class="source_code">
1079
+ <tr>
1080
+ <td>
1081
+ <pre class="lines">
1082
+
1083
+
1084
+ 158
1085
+ 159
1086
+ 160</pre>
1087
+ </td>
1088
+ <td>
1089
+ <pre class="code"><span class="info file"># File 'lib/support/holidays.rb', line 158</span>
1090
+
1091
+ <span class='kw'>def</span> <span class='id identifier rubyid_rosh_chodesh?'>rosh_chodesh?</span>
1092
+ <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>||</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>30</span>
1093
+ <span class='kw'>end</span></pre>
1094
+ </td>
1095
+ </tr>
1096
+ </table>
1097
+ </div>
1098
+
1099
+ </div>
1100
+
1101
+ </div>
1102
+
1103
+ <div id="footer">
1104
+ Generated on Thu Jan 16 19:44:44 2014 by
1105
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1106
+ 0.8.7.3 (ruby-2.0.0).
1107
+ </div>
1108
+
1109
+ </body>
1110
+ </html>