hebrew_date 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +20 -0
- data/LICENSE +20 -0
- data/README.md +76 -0
- data/doc/HebrewDate.html +2611 -0
- data/doc/HebrewDateSupport.html +117 -0
- data/doc/HebrewDateSupport/Holidays.html +1110 -0
- data/doc/HebrewDateSupport/Parshiot.html +436 -0
- data/doc/JqrHelpers/Rails.html +117 -0
- data/doc/_index.html +137 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +84 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +84 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +239 -0
- data/doc/top-level-namespace.html +114 -0
- data/hebrew_date.gemspec +22 -0
- data/lib/hebrew_date.rb +492 -0
- data/lib/support/holidays.rb +256 -0
- data/lib/support/parshiot.rb +317 -0
- data/spec/hebrew_date_spec.rb +50 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f3b6f156073f68612df127bf30cf89d2fba34146
|
4
|
+
data.tar.gz: 72fae1535747b908e8f53a2c367c79201d83941f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ea9a5d8ecab83ee60a5390acac4a0048999d74ecd3683c6be8eb108d3c44c0fbd6e377e6e0a9753188d16d1c4eece71f6d695b03ead78ae3091bfae6e52aee54
|
7
|
+
data.tar.gz: 2c108e5e976078d8f2012bc94fb757415b1bba95cd3989aac409dc98392d2eb52ddeaa61679151345ebe2293e3461135e97d0bb6526b3370ed27a7b127ffc5f4
|
data/.gitignore
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
*.rbc
|
2
|
+
*.sassc
|
3
|
+
.sass-cache
|
4
|
+
capybara-*.html
|
5
|
+
.rspec
|
6
|
+
.rvmrc
|
7
|
+
/.bundle
|
8
|
+
/vendor/bundle
|
9
|
+
/log/*
|
10
|
+
/tmp/*
|
11
|
+
/db/*.sqlite3
|
12
|
+
/public/system/*
|
13
|
+
/coverage/
|
14
|
+
/spec/tmp/*
|
15
|
+
**.orig
|
16
|
+
rerun.txt
|
17
|
+
pickle-email-*.html
|
18
|
+
.project
|
19
|
+
config/initializers/secret_token.rb
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.2.5)
|
5
|
+
rspec (2.14.1)
|
6
|
+
rspec-core (~> 2.14.0)
|
7
|
+
rspec-expectations (~> 2.14.0)
|
8
|
+
rspec-mocks (~> 2.14.0)
|
9
|
+
rspec-core (2.14.7)
|
10
|
+
rspec-expectations (2.14.4)
|
11
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
12
|
+
rspec-mocks (2.14.4)
|
13
|
+
yard (0.8.7.3)
|
14
|
+
|
15
|
+
PLATFORMS
|
16
|
+
ruby
|
17
|
+
|
18
|
+
DEPENDENCIES
|
19
|
+
rspec (~> 2.14.1)
|
20
|
+
yard (~> 0.8.7.3)
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 dorner
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# HebrewDate
|
2
|
+
|
3
|
+
`hebrew_date` is a library designed to provide information about the Jewish
|
4
|
+
calendar. This includes dates, <!---times,---> holidays, and parsha of the week.
|
5
|
+
|
6
|
+
<!---
|
7
|
+
`hebrew_date` depends on the [ruby-sun-times](https://github.com/joeyates/ruby-sun-times)
|
8
|
+
gem.
|
9
|
+
--->
|
10
|
+
|
11
|
+
Usage
|
12
|
+
=====
|
13
|
+
|
14
|
+
Full documentation can be found [here](http://rawgithub.com/dorner/hebrew_date/master/doc/index.html).
|
15
|
+
|
16
|
+
To initialize a Hebrew date, you can use either the English date:
|
17
|
+
|
18
|
+
HebrewDate.new(2009, 12, 25)
|
19
|
+
|
20
|
+
or the Hebrew one:
|
21
|
+
|
22
|
+
HebrewDate.new_from_hebrew(5775, 4, 29)
|
23
|
+
|
24
|
+
HebrewDates respond to all the methods dates do:
|
25
|
+
|
26
|
+
HebrewDate.new.saturday?
|
27
|
+
HebrewDate.new.beginning_of_week # Rails
|
28
|
+
|
29
|
+
Printing
|
30
|
+
========
|
31
|
+
|
32
|
+
HebrewDate also responds to ``strftime``, but provides a number of additional
|
33
|
+
flags for printing Hebrew dates. These are identical to the normal flags
|
34
|
+
except that they start with * instead of %:
|
35
|
+
|
36
|
+
* ``*Y`` - Hebrew year
|
37
|
+
* ``*m`` - Hebrew month, zero-padded
|
38
|
+
* ``*_m`` - Hebrew month, blank-padded
|
39
|
+
* ``*-m`` - Hebrew month, no-padded
|
40
|
+
* ``*B`` - Hebrew month, full name
|
41
|
+
* ``*^B`` - Hebrew month, full name uppercase
|
42
|
+
* ``*b`` - Hebrew month, 3 letters
|
43
|
+
* ``*^b`` - Hebrew month, 3 letters uppercase
|
44
|
+
* ``*h`` - same as %*b
|
45
|
+
* ``*d`` - Hebrew day of month, zero-padded
|
46
|
+
* ``*-d`` - Hebrew day of month, no-padded
|
47
|
+
* ``*e`` - Hebrew day of month, blank-padded
|
48
|
+
|
49
|
+
Parsha
|
50
|
+
======
|
51
|
+
|
52
|
+
You can get the parsha of the current day by calling the ``parsha`` method.
|
53
|
+
This will only return a value if it is on Shabbat. By default the parsha
|
54
|
+
will have "special" values appended to it (e.g. the special Parshiyot,
|
55
|
+
Shekalim, Zachor, Parah and Hachodesh), which can optionally be suppressed.
|
56
|
+
|
57
|
+
By default HebrewDate will use the "chutz la'aretz" parsha scheme (i.e. assuming
|
58
|
+
two-day Yom Tov). You can use the Israeli scheme by calling
|
59
|
+
|
60
|
+
HebrewDate.israeli = true
|
61
|
+
|
62
|
+
before creating your first instance of HebrewDate.
|
63
|
+
|
64
|
+
Holiday
|
65
|
+
=======
|
66
|
+
|
67
|
+
If the current date is a Jewish holiday (including Erev Yom Tov and the
|
68
|
+
"modern" holidays of Yom Ha'atzmaut, Yom Hazikaron and Yom Yerushalayim) you
|
69
|
+
can retrieve those as strings via the ``holiday`` method.
|
70
|
+
|
71
|
+
Month names, holidays and parshiyot all will be in Sephardic / Mizrachi
|
72
|
+
accents by default. You can change this to Ashkenazi pronunciation by calling
|
73
|
+
|
74
|
+
HebrewDate.ashkenazi = true
|
75
|
+
|
76
|
+
|
data/doc/HebrewDate.html
ADDED
@@ -0,0 +1,2611 @@
|
|
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
|
+
Class: HebrewDate
|
8
|
+
|
9
|
+
— 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> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">HebrewDate</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>Class: HebrewDate
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Delegator</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Delegator</li>
|
82
|
+
|
83
|
+
<li class="next">HebrewDate</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dt class="r2">Includes:</dt>
|
96
|
+
<dd class="r2"><span class='object_link'><a href="HebrewDateSupport/Holidays.html" title="HebrewDateSupport::Holidays (module)">HebrewDateSupport::Holidays</a></span>, <span class='object_link'><a href="HebrewDateSupport/Parshiot.html" title="HebrewDateSupport::Parshiot (module)">HebrewDateSupport::Parshiot</a></span></dd>
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<dt class="r1 last">Defined in:</dt>
|
103
|
+
<dd class="r1 last">lib/hebrew_date.rb</dd>
|
104
|
+
|
105
|
+
</dl>
|
106
|
+
<div class="clear"></div>
|
107
|
+
|
108
|
+
<h2>Overview</h2><div class="docstring">
|
109
|
+
<div class="discussion">
|
110
|
+
|
111
|
+
<p>A class that represents a date in both the Gregorian and Hebrew calendars
|
112
|
+
simultaneously. Note that you may call any Date methods on this class and
|
113
|
+
it should respond accordingly.</p>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
<div class="tags">
|
119
|
+
|
120
|
+
|
121
|
+
</div>
|
122
|
+
<h2>Constant Summary</h2>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
129
|
+
<ul class="summary">
|
130
|
+
|
131
|
+
<li class="public ">
|
132
|
+
<span class="summary_signature">
|
133
|
+
|
134
|
+
<a href="#ashkenaz-class_method" title="ashkenaz (class method)">+ (Boolean) <strong>ashkenaz</strong> </a>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<span class="summary_desc"><div class='inline'>
|
152
|
+
<p>Whether to use Ashkenazi pronunciation.</p>
|
153
|
+
</div></span>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
|
157
|
+
|
158
|
+
<li class="public ">
|
159
|
+
<span class="summary_signature">
|
160
|
+
|
161
|
+
<a href="#israeli-class_method" title="israeli (class method)">+ (Boolean) <strong>israeli</strong> </a>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
</span>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<span class="summary_desc"><div class='inline'>
|
179
|
+
<p>Whether to use Israeli parsha/holiday scheme.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
</ul>
|
186
|
+
|
187
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
188
|
+
<ul class="summary">
|
189
|
+
|
190
|
+
<li class="public ">
|
191
|
+
<span class="summary_signature">
|
192
|
+
|
193
|
+
<a href="#date-instance_method" title="#date (instance method)">- (Integer) <strong>date</strong> </a>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="note title readonly">readonly</span>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<span class="summary_desc"><div class='inline'>
|
213
|
+
<p>The current Gregorian day of the month (1-31).</p>
|
214
|
+
</div></span>
|
215
|
+
|
216
|
+
</li>
|
217
|
+
|
218
|
+
|
219
|
+
<li class="public ">
|
220
|
+
<span class="summary_signature">
|
221
|
+
|
222
|
+
<a href="#hebrew_date-instance_method" title="#hebrew_date (instance method)">- (Integer) <strong>hebrew_date</strong> </a>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</span>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<span class="note title readonly">readonly</span>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<span class="summary_desc"><div class='inline'>
|
242
|
+
<p>The current Hebrew date (1-30).</p>
|
243
|
+
</div></span>
|
244
|
+
|
245
|
+
</li>
|
246
|
+
|
247
|
+
|
248
|
+
<li class="public ">
|
249
|
+
<span class="summary_signature">
|
250
|
+
|
251
|
+
<a href="#hebrew_month-instance_method" title="#hebrew_month (instance method)">- (Integer) <strong>hebrew_month</strong> </a>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</span>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<span class="note title readonly">readonly</span>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<span class="summary_desc"><div class='inline'>
|
271
|
+
<p>The current Hebrew month (1-13).</p>
|
272
|
+
</div></span>
|
273
|
+
|
274
|
+
</li>
|
275
|
+
|
276
|
+
|
277
|
+
<li class="public ">
|
278
|
+
<span class="summary_signature">
|
279
|
+
|
280
|
+
<a href="#hebrew_year-instance_method" title="#hebrew_year (instance method)">- (Integer) <strong>hebrew_year</strong> </a>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
</span>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<span class="note title readonly">readonly</span>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
<span class="summary_desc"><div class='inline'>
|
300
|
+
<p>The current Hebrew year (e.g. 5775).</p>
|
301
|
+
</div></span>
|
302
|
+
|
303
|
+
</li>
|
304
|
+
|
305
|
+
|
306
|
+
<li class="public ">
|
307
|
+
<span class="summary_signature">
|
308
|
+
|
309
|
+
<a href="#month-instance_method" title="#month (instance method)">- (Integer) <strong>month</strong> </a>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
</span>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
<span class="note title readonly">readonly</span>
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
<span class="summary_desc"><div class='inline'>
|
329
|
+
<p>The current Gregorian month (1-12).</p>
|
330
|
+
</div></span>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
|
335
|
+
<li class="public ">
|
336
|
+
<span class="summary_signature">
|
337
|
+
|
338
|
+
<a href="#year-instance_method" title="#year (instance method)">- (Integer) <strong>year</strong> </a>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
</span>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
<span class="note title readonly">readonly</span>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
<span class="summary_desc"><div class='inline'>
|
358
|
+
<p>The current Gregorian year (e.g. 2008).</p>
|
359
|
+
</div></span>
|
360
|
+
|
361
|
+
</li>
|
362
|
+
|
363
|
+
|
364
|
+
</ul>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
<h2>
|
371
|
+
Class Method Summary
|
372
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
373
|
+
</h2>
|
374
|
+
|
375
|
+
<ul class="summary">
|
376
|
+
|
377
|
+
<li class="public ">
|
378
|
+
<span class="summary_signature">
|
379
|
+
|
380
|
+
<a href="#new_from_hebrew-class_method" title="new_from_hebrew (class method)">+ (Object) <strong>new_from_hebrew</strong>(year, month, date) </a>
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
</span>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
<span class="summary_desc"><div class='inline'>
|
395
|
+
<p>Create a HebrewDate with initialized Hebrew date values.</p>
|
396
|
+
</div></span>
|
397
|
+
|
398
|
+
</li>
|
399
|
+
|
400
|
+
|
401
|
+
</ul>
|
402
|
+
|
403
|
+
<h2>
|
404
|
+
Instance Method Summary
|
405
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
406
|
+
</h2>
|
407
|
+
|
408
|
+
<ul class="summary">
|
409
|
+
|
410
|
+
<li class="public ">
|
411
|
+
<span class="summary_signature">
|
412
|
+
|
413
|
+
<a href="#back-instance_method" title="#back (instance method)">- (void) <strong>back</strong> </a>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
</span>
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
<span class="summary_desc"><div class='inline'>
|
428
|
+
<p>Move back one day.</p>
|
429
|
+
</div></span>
|
430
|
+
|
431
|
+
</li>
|
432
|
+
|
433
|
+
|
434
|
+
<li class="public ">
|
435
|
+
<span class="summary_signature">
|
436
|
+
|
437
|
+
<a href="#clone-instance_method" title="#clone (instance method)">- (HebrewDate) <strong>clone</strong> </a>
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
</span>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
<span class="summary_desc"><div class='inline'>
|
452
|
+
<p>Get a clone of this object.</p>
|
453
|
+
</div></span>
|
454
|
+
|
455
|
+
</li>
|
456
|
+
|
457
|
+
|
458
|
+
<li class="public ">
|
459
|
+
<span class="summary_signature">
|
460
|
+
|
461
|
+
<a href="#day-instance_method" title="#day (instance method)">- (Integer) <strong>day</strong> </a>
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
</span>
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
<span class="summary_desc"><div class='inline'>
|
476
|
+
<p>Get the day of the week.</p>
|
477
|
+
</div></span>
|
478
|
+
|
479
|
+
</li>
|
480
|
+
|
481
|
+
|
482
|
+
<li class="public ">
|
483
|
+
<span class="summary_signature">
|
484
|
+
|
485
|
+
<a href="#forward-instance_method" title="#forward (instance method)">- (void) <strong>forward</strong> </a>
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
</span>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
<span class="summary_desc"><div class='inline'>
|
500
|
+
<p>Move forward one day.</p>
|
501
|
+
</div></span>
|
502
|
+
|
503
|
+
</li>
|
504
|
+
|
505
|
+
|
506
|
+
<li class="public ">
|
507
|
+
<span class="summary_signature">
|
508
|
+
|
509
|
+
<a href="#hebrew_leap_year%3F-instance_method" title="#hebrew_leap_year? (instance method)">- (Boolean) <strong>hebrew_leap_year?</strong>(year = nil) </a>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
</span>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
<span class="summary_desc"><div class='inline'>
|
524
|
+
<p>Is this a Hebrew leap year?.</p>
|
525
|
+
</div></span>
|
526
|
+
|
527
|
+
</li>
|
528
|
+
|
529
|
+
|
530
|
+
<li class="public ">
|
531
|
+
<span class="summary_signature">
|
532
|
+
|
533
|
+
<a href="#hebrew_month_to_s-instance_method" title="#hebrew_month_to_s (instance method)">- (String) <strong>hebrew_month_to_s</strong> </a>
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
</span>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
<span class="summary_desc"><div class='inline'>
|
548
|
+
<p>Get the name of the current Hebrew month.</p>
|
549
|
+
</div></span>
|
550
|
+
|
551
|
+
</li>
|
552
|
+
|
553
|
+
|
554
|
+
<li class="public ">
|
555
|
+
<span class="summary_signature">
|
556
|
+
|
557
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (HebrewDate) <strong>initialize</strong>(year_or_date_object = nil, month = nil, date = nil) </a>
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
</span>
|
562
|
+
|
563
|
+
|
564
|
+
<span class="note title constructor">constructor</span>
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
<span class="summary_desc"><div class='inline'>
|
574
|
+
<p>A new instance of HebrewDate.</p>
|
575
|
+
</div></span>
|
576
|
+
|
577
|
+
</li>
|
578
|
+
|
579
|
+
|
580
|
+
<li class="public ">
|
581
|
+
<span class="summary_signature">
|
582
|
+
|
583
|
+
<a href="#last_day_of_hebrew_month-instance_method" title="#last_day_of_hebrew_month (instance method)">- (Integer) <strong>last_day_of_hebrew_month</strong>(month = nil) </a>
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
</span>
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
<span class="summary_desc"><div class='inline'>
|
598
|
+
<p>Last day of the current Hebrew month.</p>
|
599
|
+
</div></span>
|
600
|
+
|
601
|
+
</li>
|
602
|
+
|
603
|
+
|
604
|
+
<li class="public ">
|
605
|
+
<span class="summary_signature">
|
606
|
+
|
607
|
+
<a href="#last_day_of_month-instance_method" title="#last_day_of_month (instance method)">- (Integer) <strong>last_day_of_month</strong>(month = nil) </a>
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
</span>
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
<span class="summary_desc"><div class='inline'>
|
622
|
+
<p>The last day of the Gregorian month.</p>
|
623
|
+
</div></span>
|
624
|
+
|
625
|
+
</li>
|
626
|
+
|
627
|
+
|
628
|
+
<li class="public ">
|
629
|
+
<span class="summary_signature">
|
630
|
+
|
631
|
+
<a href="#last_month_of_hebrew_year-instance_method" title="#last_month_of_hebrew_year (instance method)">- (Integer) <strong>last_month_of_hebrew_year</strong> </a>
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
</span>
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
<span class="summary_desc"><div class='inline'>
|
646
|
+
<p>The last month in this Hebrew year (12 or 13).</p>
|
647
|
+
</div></span>
|
648
|
+
|
649
|
+
</li>
|
650
|
+
|
651
|
+
|
652
|
+
<li class="public ">
|
653
|
+
<span class="summary_signature">
|
654
|
+
|
655
|
+
<a href="#set_date-instance_method" title="#set_date (instance method)">- (void) <strong>set_date</strong>(year, month, date) </a>
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
</span>
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
<span class="summary_desc"><div class='inline'>
|
670
|
+
<p>Set the Gregorian date of this HebrewDate.</p>
|
671
|
+
</div></span>
|
672
|
+
|
673
|
+
</li>
|
674
|
+
|
675
|
+
|
676
|
+
<li class="public ">
|
677
|
+
<span class="summary_signature">
|
678
|
+
|
679
|
+
<a href="#set_hebrew_date-instance_method" title="#set_hebrew_date (instance method)">- (void) <strong>set_hebrew_date</strong>(year, month, date) </a>
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
</span>
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
<span class="summary_desc"><div class='inline'>
|
694
|
+
<p>Set the Hebrew date.</p>
|
695
|
+
</div></span>
|
696
|
+
|
697
|
+
</li>
|
698
|
+
|
699
|
+
|
700
|
+
<li class="public ">
|
701
|
+
<span class="summary_signature">
|
702
|
+
|
703
|
+
<a href="#strftime-instance_method" title="#strftime (instance method)">- (String) <strong>strftime</strong>(format) </a>
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
</span>
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
|
716
|
+
|
717
|
+
<span class="summary_desc"><div class='inline'>
|
718
|
+
<p>Extend the Date strftime method by replacing Hebrew fields.</p>
|
719
|
+
</div></span>
|
720
|
+
|
721
|
+
</li>
|
722
|
+
|
723
|
+
|
724
|
+
<li class="public ">
|
725
|
+
<span class="summary_signature">
|
726
|
+
|
727
|
+
<a href="#to_date-instance_method" title="#to_date (instance method)">- (Date) <strong>to_date</strong> </a>
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
</span>
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
<span class="summary_desc"><div class='inline'>
|
742
|
+
<p>Return a Ruby Date corresponding to the Gregorian date.</p>
|
743
|
+
</div></span>
|
744
|
+
|
745
|
+
</li>
|
746
|
+
|
747
|
+
|
748
|
+
</ul>
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="HebrewDateSupport/Holidays.html" title="HebrewDateSupport::Holidays (module)">HebrewDateSupport::Holidays</a></span></h3>
|
761
|
+
<p class="inherited"><span class='object_link'><a href="HebrewDateSupport/Holidays.html#candle_lighting_day%3F-instance_method" title="HebrewDateSupport::Holidays#candle_lighting_day? (method)">#candle_lighting_day?</a></span>, <span class='object_link'><a href="HebrewDateSupport/Holidays.html#first_day_yom_tov%3F-instance_method" title="HebrewDateSupport::Holidays#first_day_yom_tov? (method)">#first_day_yom_tov?</a></span>, <span class='object_link'><a href="HebrewDateSupport/Holidays.html#havdala_day%3F-instance_method" title="HebrewDateSupport::Holidays#havdala_day? (method)">#havdala_day?</a></span>, <span class='object_link'><a href="HebrewDateSupport/Holidays.html#holiday-instance_method" title="HebrewDateSupport::Holidays#holiday (method)">#holiday</a></span>, <span class='object_link'><a href="HebrewDateSupport/Holidays.html#omer-instance_method" title="HebrewDateSupport::Holidays#omer (method)">#omer</a></span>, <span class='object_link'><a href="HebrewDateSupport/Holidays.html#omer_to_s-instance_method" title="HebrewDateSupport::Holidays#omer_to_s (method)">#omer_to_s</a></span>, <span class='object_link'><a href="HebrewDateSupport/Holidays.html#rosh_chodesh%3F-instance_method" title="HebrewDateSupport::Holidays#rosh_chodesh? (method)">#rosh_chodesh?</a></span></p>
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
|
770
|
+
|
771
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="HebrewDateSupport/Parshiot.html" title="HebrewDateSupport::Parshiot (module)">HebrewDateSupport::Parshiot</a></span></h3>
|
772
|
+
<p class="inherited"><span class='object_link'><a href="HebrewDateSupport/Parshiot.html#parsha-instance_method" title="HebrewDateSupport::Parshiot#parsha (method)">#parsha</a></span></p>
|
773
|
+
|
774
|
+
<div id="constructor_details" class="method_details_list">
|
775
|
+
<h2>Constructor Details</h2>
|
776
|
+
|
777
|
+
<div class="method_details first">
|
778
|
+
<h3 class="signature first" id="initialize-instance_method">
|
779
|
+
|
780
|
+
- (<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>) <strong>initialize</strong>(year_or_date_object = nil, month = nil, date = nil)
|
781
|
+
|
782
|
+
|
783
|
+
|
784
|
+
|
785
|
+
|
786
|
+
</h3><div class="docstring">
|
787
|
+
<div class="discussion">
|
788
|
+
|
789
|
+
<p>Returns a new instance of HebrewDate</p>
|
790
|
+
|
791
|
+
|
792
|
+
</div>
|
793
|
+
</div>
|
794
|
+
<div class="tags">
|
795
|
+
|
796
|
+
|
797
|
+
</div><table class="source_code">
|
798
|
+
<tr>
|
799
|
+
<td>
|
800
|
+
<pre class="lines">
|
801
|
+
|
802
|
+
|
803
|
+
59
|
804
|
+
60
|
805
|
+
61
|
806
|
+
62
|
807
|
+
63
|
808
|
+
64
|
809
|
+
65
|
810
|
+
66
|
811
|
+
67
|
812
|
+
68
|
813
|
+
69
|
814
|
+
70
|
815
|
+
71
|
816
|
+
72
|
817
|
+
73
|
818
|
+
74
|
819
|
+
75
|
820
|
+
76
|
821
|
+
77</pre>
|
822
|
+
</td>
|
823
|
+
<td>
|
824
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 59</span>
|
825
|
+
|
826
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_year_or_date_object'>year_or_date_object</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
827
|
+
<span class='ivar'>@abs_date</span> <span class='op'>=</span> <span class='int'>0</span>
|
828
|
+
|
829
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_month'>month</span> <span class='op'>&&</span> <span class='id identifier rubyid_date'>date</span>
|
830
|
+
<span class='ivar'>@year</span> <span class='op'>=</span> <span class='id identifier rubyid_year_or_date_object'>year_or_date_object</span>
|
831
|
+
<span class='ivar'>@month</span> <span class='op'>=</span> <span class='id identifier rubyid_month'>month</span>
|
832
|
+
<span class='ivar'>@date</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span>
|
833
|
+
<span class='kw'>else</span>
|
834
|
+
<span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='id identifier rubyid_year_or_date_object'>year_or_date_object</span> <span class='op'>||</span> <span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_today'>today</span>
|
835
|
+
<span class='ivar'>@year</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span>
|
836
|
+
<span class='ivar'>@month</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span>
|
837
|
+
<span class='ivar'>@date</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_mday'>mday</span>
|
838
|
+
<span class='kw'>end</span>
|
839
|
+
<span class='ivar'>@israeli</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_israeli'>israeli</span>
|
840
|
+
<span class='ivar'>@ashkenaz</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_ashkenaz'>ashkenaz</span>
|
841
|
+
<span class='ivar'>@debug</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span>
|
842
|
+
<span class='id identifier rubyid_set_date'>set_date</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='comma'>,</span> <span class='ivar'>@month</span><span class='comma'>,</span> <span class='ivar'>@date</span><span class='rparen'>)</span>
|
843
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
|
844
|
+
<span class='kw'>end</span></pre>
|
845
|
+
</td>
|
846
|
+
</tr>
|
847
|
+
</table>
|
848
|
+
</div>
|
849
|
+
|
850
|
+
</div>
|
851
|
+
|
852
|
+
<div id="class_attr_details" class="attr_details">
|
853
|
+
<h2>Class Attribute Details</h2>
|
854
|
+
|
855
|
+
|
856
|
+
<span id="ashkenaz=-class_method"></span>
|
857
|
+
<div class="method_details first">
|
858
|
+
<h3 class="signature first" id="ashkenaz-class_method">
|
859
|
+
|
860
|
+
+ (<tt>Boolean</tt>) <strong>ashkenaz</strong>
|
861
|
+
|
862
|
+
|
863
|
+
|
864
|
+
|
865
|
+
|
866
|
+
</h3><div class="docstring">
|
867
|
+
<div class="discussion">
|
868
|
+
|
869
|
+
<p>Returns Whether to use Ashkenazi pronunciation.</p>
|
870
|
+
|
871
|
+
|
872
|
+
</div>
|
873
|
+
</div>
|
874
|
+
<div class="tags">
|
875
|
+
|
876
|
+
<p class="tag_title">Returns:</p>
|
877
|
+
<ul class="return">
|
878
|
+
|
879
|
+
<li>
|
880
|
+
|
881
|
+
|
882
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
883
|
+
|
884
|
+
|
885
|
+
|
886
|
+
—
|
887
|
+
<div class='inline'>
|
888
|
+
<p>Whether to use Ashkenazi pronunciation.</p>
|
889
|
+
</div>
|
890
|
+
|
891
|
+
</li>
|
892
|
+
|
893
|
+
</ul>
|
894
|
+
|
895
|
+
</div><table class="source_code">
|
896
|
+
<tr>
|
897
|
+
<td>
|
898
|
+
<pre class="lines">
|
899
|
+
|
900
|
+
|
901
|
+
28
|
902
|
+
29
|
903
|
+
30</pre>
|
904
|
+
</td>
|
905
|
+
<td>
|
906
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 28</span>
|
907
|
+
|
908
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ashkenaz'>ashkenaz</span>
|
909
|
+
<span class='ivar'>@ashkenaz</span>
|
910
|
+
<span class='kw'>end</span></pre>
|
911
|
+
</td>
|
912
|
+
</tr>
|
913
|
+
</table>
|
914
|
+
</div>
|
915
|
+
|
916
|
+
|
917
|
+
<span id="israeli=-class_method"></span>
|
918
|
+
<div class="method_details ">
|
919
|
+
<h3 class="signature " id="israeli-class_method">
|
920
|
+
|
921
|
+
+ (<tt>Boolean</tt>) <strong>israeli</strong>
|
922
|
+
|
923
|
+
|
924
|
+
|
925
|
+
|
926
|
+
|
927
|
+
</h3><div class="docstring">
|
928
|
+
<div class="discussion">
|
929
|
+
|
930
|
+
<p>Returns Whether to use Israeli parsha/holiday scheme.</p>
|
931
|
+
|
932
|
+
|
933
|
+
</div>
|
934
|
+
</div>
|
935
|
+
<div class="tags">
|
936
|
+
|
937
|
+
<p class="tag_title">Returns:</p>
|
938
|
+
<ul class="return">
|
939
|
+
|
940
|
+
<li>
|
941
|
+
|
942
|
+
|
943
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
944
|
+
|
945
|
+
|
946
|
+
|
947
|
+
—
|
948
|
+
<div class='inline'>
|
949
|
+
<p>Whether to use Israeli parsha/holiday scheme.</p>
|
950
|
+
</div>
|
951
|
+
|
952
|
+
</li>
|
953
|
+
|
954
|
+
</ul>
|
955
|
+
|
956
|
+
</div><table class="source_code">
|
957
|
+
<tr>
|
958
|
+
<td>
|
959
|
+
<pre class="lines">
|
960
|
+
|
961
|
+
|
962
|
+
31
|
963
|
+
32
|
964
|
+
33</pre>
|
965
|
+
</td>
|
966
|
+
<td>
|
967
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 31</span>
|
968
|
+
|
969
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_israeli'>israeli</span>
|
970
|
+
<span class='ivar'>@israeli</span>
|
971
|
+
<span class='kw'>end</span></pre>
|
972
|
+
</td>
|
973
|
+
</tr>
|
974
|
+
</table>
|
975
|
+
</div>
|
976
|
+
|
977
|
+
</div>
|
978
|
+
|
979
|
+
<div id="instance_attr_details" class="attr_details">
|
980
|
+
<h2>Instance Attribute Details</h2>
|
981
|
+
|
982
|
+
|
983
|
+
<span id=""></span>
|
984
|
+
<div class="method_details first">
|
985
|
+
<h3 class="signature first" id="date-instance_method">
|
986
|
+
|
987
|
+
- (<tt>Integer</tt>) <strong>date</strong> <span class="extras">(readonly)</span>
|
988
|
+
|
989
|
+
|
990
|
+
|
991
|
+
|
992
|
+
|
993
|
+
</h3><div class="docstring">
|
994
|
+
<div class="discussion">
|
995
|
+
|
996
|
+
<p>Returns the current Gregorian day of the month (1-31).</p>
|
997
|
+
|
998
|
+
|
999
|
+
</div>
|
1000
|
+
</div>
|
1001
|
+
<div class="tags">
|
1002
|
+
|
1003
|
+
<p class="tag_title">Returns:</p>
|
1004
|
+
<ul class="return">
|
1005
|
+
|
1006
|
+
<li>
|
1007
|
+
|
1008
|
+
|
1009
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1010
|
+
|
1011
|
+
|
1012
|
+
|
1013
|
+
—
|
1014
|
+
<div class='inline'>
|
1015
|
+
<p>the current Gregorian day of the month (1-31).</p>
|
1016
|
+
</div>
|
1017
|
+
|
1018
|
+
</li>
|
1019
|
+
|
1020
|
+
</ul>
|
1021
|
+
|
1022
|
+
</div><table class="source_code">
|
1023
|
+
<tr>
|
1024
|
+
<td>
|
1025
|
+
<pre class="lines">
|
1026
|
+
|
1027
|
+
|
1028
|
+
45
|
1029
|
+
46
|
1030
|
+
47</pre>
|
1031
|
+
</td>
|
1032
|
+
<td>
|
1033
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 45</span>
|
1034
|
+
|
1035
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_date'>date</span>
|
1036
|
+
<span class='ivar'>@date</span>
|
1037
|
+
<span class='kw'>end</span></pre>
|
1038
|
+
</td>
|
1039
|
+
</tr>
|
1040
|
+
</table>
|
1041
|
+
</div>
|
1042
|
+
|
1043
|
+
|
1044
|
+
<span id=""></span>
|
1045
|
+
<div class="method_details ">
|
1046
|
+
<h3 class="signature " id="hebrew_date-instance_method">
|
1047
|
+
|
1048
|
+
- (<tt>Integer</tt>) <strong>hebrew_date</strong> <span class="extras">(readonly)</span>
|
1049
|
+
|
1050
|
+
|
1051
|
+
|
1052
|
+
|
1053
|
+
|
1054
|
+
</h3><div class="docstring">
|
1055
|
+
<div class="discussion">
|
1056
|
+
|
1057
|
+
<p>Returns the current Hebrew date (1-30).</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>Integer</tt>)</span>
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
—
|
1075
|
+
<div class='inline'>
|
1076
|
+
<p>the current Hebrew date (1-30).</p>
|
1077
|
+
</div>
|
1078
|
+
|
1079
|
+
</li>
|
1080
|
+
|
1081
|
+
</ul>
|
1082
|
+
|
1083
|
+
</div><table class="source_code">
|
1084
|
+
<tr>
|
1085
|
+
<td>
|
1086
|
+
<pre class="lines">
|
1087
|
+
|
1088
|
+
|
1089
|
+
54
|
1090
|
+
55
|
1091
|
+
56</pre>
|
1092
|
+
</td>
|
1093
|
+
<td>
|
1094
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 54</span>
|
1095
|
+
|
1096
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hebrew_date'>hebrew_date</span>
|
1097
|
+
<span class='ivar'>@hebrew_date</span>
|
1098
|
+
<span class='kw'>end</span></pre>
|
1099
|
+
</td>
|
1100
|
+
</tr>
|
1101
|
+
</table>
|
1102
|
+
</div>
|
1103
|
+
|
1104
|
+
|
1105
|
+
<span id=""></span>
|
1106
|
+
<div class="method_details ">
|
1107
|
+
<h3 class="signature " id="hebrew_month-instance_method">
|
1108
|
+
|
1109
|
+
- (<tt>Integer</tt>) <strong>hebrew_month</strong> <span class="extras">(readonly)</span>
|
1110
|
+
|
1111
|
+
|
1112
|
+
|
1113
|
+
|
1114
|
+
|
1115
|
+
</h3><div class="docstring">
|
1116
|
+
<div class="discussion">
|
1117
|
+
|
1118
|
+
<p>Returns the current Hebrew month (1-13).</p>
|
1119
|
+
|
1120
|
+
|
1121
|
+
</div>
|
1122
|
+
</div>
|
1123
|
+
<div class="tags">
|
1124
|
+
|
1125
|
+
<p class="tag_title">Returns:</p>
|
1126
|
+
<ul class="return">
|
1127
|
+
|
1128
|
+
<li>
|
1129
|
+
|
1130
|
+
|
1131
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1132
|
+
|
1133
|
+
|
1134
|
+
|
1135
|
+
—
|
1136
|
+
<div class='inline'>
|
1137
|
+
<p>the current Hebrew month (1-13).</p>
|
1138
|
+
</div>
|
1139
|
+
|
1140
|
+
</li>
|
1141
|
+
|
1142
|
+
</ul>
|
1143
|
+
|
1144
|
+
</div><table class="source_code">
|
1145
|
+
<tr>
|
1146
|
+
<td>
|
1147
|
+
<pre class="lines">
|
1148
|
+
|
1149
|
+
|
1150
|
+
51
|
1151
|
+
52
|
1152
|
+
53</pre>
|
1153
|
+
</td>
|
1154
|
+
<td>
|
1155
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 51</span>
|
1156
|
+
|
1157
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hebrew_month'>hebrew_month</span>
|
1158
|
+
<span class='ivar'>@hebrew_month</span>
|
1159
|
+
<span class='kw'>end</span></pre>
|
1160
|
+
</td>
|
1161
|
+
</tr>
|
1162
|
+
</table>
|
1163
|
+
</div>
|
1164
|
+
|
1165
|
+
|
1166
|
+
<span id=""></span>
|
1167
|
+
<div class="method_details ">
|
1168
|
+
<h3 class="signature " id="hebrew_year-instance_method">
|
1169
|
+
|
1170
|
+
- (<tt>Integer</tt>) <strong>hebrew_year</strong> <span class="extras">(readonly)</span>
|
1171
|
+
|
1172
|
+
|
1173
|
+
|
1174
|
+
|
1175
|
+
|
1176
|
+
</h3><div class="docstring">
|
1177
|
+
<div class="discussion">
|
1178
|
+
|
1179
|
+
<p>Returns the current Hebrew year (e.g. 5775).</p>
|
1180
|
+
|
1181
|
+
|
1182
|
+
</div>
|
1183
|
+
</div>
|
1184
|
+
<div class="tags">
|
1185
|
+
|
1186
|
+
<p class="tag_title">Returns:</p>
|
1187
|
+
<ul class="return">
|
1188
|
+
|
1189
|
+
<li>
|
1190
|
+
|
1191
|
+
|
1192
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1193
|
+
|
1194
|
+
|
1195
|
+
|
1196
|
+
—
|
1197
|
+
<div class='inline'>
|
1198
|
+
<p>the current Hebrew year (e.g. 5775).</p>
|
1199
|
+
</div>
|
1200
|
+
|
1201
|
+
</li>
|
1202
|
+
|
1203
|
+
</ul>
|
1204
|
+
|
1205
|
+
</div><table class="source_code">
|
1206
|
+
<tr>
|
1207
|
+
<td>
|
1208
|
+
<pre class="lines">
|
1209
|
+
|
1210
|
+
|
1211
|
+
48
|
1212
|
+
49
|
1213
|
+
50</pre>
|
1214
|
+
</td>
|
1215
|
+
<td>
|
1216
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 48</span>
|
1217
|
+
|
1218
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hebrew_year'>hebrew_year</span>
|
1219
|
+
<span class='ivar'>@hebrew_year</span>
|
1220
|
+
<span class='kw'>end</span></pre>
|
1221
|
+
</td>
|
1222
|
+
</tr>
|
1223
|
+
</table>
|
1224
|
+
</div>
|
1225
|
+
|
1226
|
+
|
1227
|
+
<span id=""></span>
|
1228
|
+
<div class="method_details ">
|
1229
|
+
<h3 class="signature " id="month-instance_method">
|
1230
|
+
|
1231
|
+
- (<tt>Integer</tt>) <strong>month</strong> <span class="extras">(readonly)</span>
|
1232
|
+
|
1233
|
+
|
1234
|
+
|
1235
|
+
|
1236
|
+
|
1237
|
+
</h3><div class="docstring">
|
1238
|
+
<div class="discussion">
|
1239
|
+
|
1240
|
+
<p>Returns the current Gregorian month (1-12).</p>
|
1241
|
+
|
1242
|
+
|
1243
|
+
</div>
|
1244
|
+
</div>
|
1245
|
+
<div class="tags">
|
1246
|
+
|
1247
|
+
<p class="tag_title">Returns:</p>
|
1248
|
+
<ul class="return">
|
1249
|
+
|
1250
|
+
<li>
|
1251
|
+
|
1252
|
+
|
1253
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1254
|
+
|
1255
|
+
|
1256
|
+
|
1257
|
+
—
|
1258
|
+
<div class='inline'>
|
1259
|
+
<p>the current Gregorian month (1-12).</p>
|
1260
|
+
</div>
|
1261
|
+
|
1262
|
+
</li>
|
1263
|
+
|
1264
|
+
</ul>
|
1265
|
+
|
1266
|
+
</div><table class="source_code">
|
1267
|
+
<tr>
|
1268
|
+
<td>
|
1269
|
+
<pre class="lines">
|
1270
|
+
|
1271
|
+
|
1272
|
+
42
|
1273
|
+
43
|
1274
|
+
44</pre>
|
1275
|
+
</td>
|
1276
|
+
<td>
|
1277
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 42</span>
|
1278
|
+
|
1279
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_month'>month</span>
|
1280
|
+
<span class='ivar'>@month</span>
|
1281
|
+
<span class='kw'>end</span></pre>
|
1282
|
+
</td>
|
1283
|
+
</tr>
|
1284
|
+
</table>
|
1285
|
+
</div>
|
1286
|
+
|
1287
|
+
|
1288
|
+
<span id=""></span>
|
1289
|
+
<div class="method_details ">
|
1290
|
+
<h3 class="signature " id="year-instance_method">
|
1291
|
+
|
1292
|
+
- (<tt>Integer</tt>) <strong>year</strong> <span class="extras">(readonly)</span>
|
1293
|
+
|
1294
|
+
|
1295
|
+
|
1296
|
+
|
1297
|
+
|
1298
|
+
</h3><div class="docstring">
|
1299
|
+
<div class="discussion">
|
1300
|
+
|
1301
|
+
<p>Returns the current Gregorian year (e.g. 2008).</p>
|
1302
|
+
|
1303
|
+
|
1304
|
+
</div>
|
1305
|
+
</div>
|
1306
|
+
<div class="tags">
|
1307
|
+
|
1308
|
+
<p class="tag_title">Returns:</p>
|
1309
|
+
<ul class="return">
|
1310
|
+
|
1311
|
+
<li>
|
1312
|
+
|
1313
|
+
|
1314
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1315
|
+
|
1316
|
+
|
1317
|
+
|
1318
|
+
—
|
1319
|
+
<div class='inline'>
|
1320
|
+
<p>the current Gregorian year (e.g. 2008).</p>
|
1321
|
+
</div>
|
1322
|
+
|
1323
|
+
</li>
|
1324
|
+
|
1325
|
+
</ul>
|
1326
|
+
|
1327
|
+
</div><table class="source_code">
|
1328
|
+
<tr>
|
1329
|
+
<td>
|
1330
|
+
<pre class="lines">
|
1331
|
+
|
1332
|
+
|
1333
|
+
39
|
1334
|
+
40
|
1335
|
+
41</pre>
|
1336
|
+
</td>
|
1337
|
+
<td>
|
1338
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 39</span>
|
1339
|
+
|
1340
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_year'>year</span>
|
1341
|
+
<span class='ivar'>@year</span>
|
1342
|
+
<span class='kw'>end</span></pre>
|
1343
|
+
</td>
|
1344
|
+
</tr>
|
1345
|
+
</table>
|
1346
|
+
</div>
|
1347
|
+
|
1348
|
+
</div>
|
1349
|
+
|
1350
|
+
|
1351
|
+
<div id="class_method_details" class="method_details_list">
|
1352
|
+
<h2>Class Method Details</h2>
|
1353
|
+
|
1354
|
+
|
1355
|
+
<div class="method_details first">
|
1356
|
+
<h3 class="signature first" id="new_from_hebrew-class_method">
|
1357
|
+
|
1358
|
+
+ (<tt>Object</tt>) <strong>new_from_hebrew</strong>(year, month, date)
|
1359
|
+
|
1360
|
+
|
1361
|
+
|
1362
|
+
|
1363
|
+
|
1364
|
+
</h3><div class="docstring">
|
1365
|
+
<div class="discussion">
|
1366
|
+
|
1367
|
+
<p>Create a HebrewDate with initialized Hebrew date values.</p>
|
1368
|
+
|
1369
|
+
|
1370
|
+
</div>
|
1371
|
+
</div>
|
1372
|
+
<div class="tags">
|
1373
|
+
<p class="tag_title">Parameters:</p>
|
1374
|
+
<ul class="param">
|
1375
|
+
|
1376
|
+
<li>
|
1377
|
+
|
1378
|
+
<span class='name'>year</span>
|
1379
|
+
|
1380
|
+
|
1381
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1382
|
+
|
1383
|
+
|
1384
|
+
|
1385
|
+
—
|
1386
|
+
<div class='inline'>
|
1387
|
+
<p>the Hebrew year (e.g. 5774)</p>
|
1388
|
+
</div>
|
1389
|
+
|
1390
|
+
</li>
|
1391
|
+
|
1392
|
+
<li>
|
1393
|
+
|
1394
|
+
<span class='name'>month</span>
|
1395
|
+
|
1396
|
+
|
1397
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1398
|
+
|
1399
|
+
|
1400
|
+
|
1401
|
+
—
|
1402
|
+
<div class='inline'>
|
1403
|
+
<p>the Hebrew month (1-13)</p>
|
1404
|
+
</div>
|
1405
|
+
|
1406
|
+
</li>
|
1407
|
+
|
1408
|
+
<li>
|
1409
|
+
|
1410
|
+
<span class='name'>date</span>
|
1411
|
+
|
1412
|
+
|
1413
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1414
|
+
|
1415
|
+
|
1416
|
+
|
1417
|
+
—
|
1418
|
+
<div class='inline'>
|
1419
|
+
<p>the day of the Hebrew month (1-30)</p>
|
1420
|
+
</div>
|
1421
|
+
|
1422
|
+
</li>
|
1423
|
+
|
1424
|
+
</ul>
|
1425
|
+
|
1426
|
+
|
1427
|
+
</div><table class="source_code">
|
1428
|
+
<tr>
|
1429
|
+
<td>
|
1430
|
+
<pre class="lines">
|
1431
|
+
|
1432
|
+
|
1433
|
+
104
|
1434
|
+
105
|
1435
|
+
106
|
1436
|
+
107
|
1437
|
+
108</pre>
|
1438
|
+
</td>
|
1439
|
+
<td>
|
1440
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 104</span>
|
1441
|
+
|
1442
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_from_hebrew'>new_from_hebrew</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
|
1443
|
+
<span class='id identifier rubyid_d'>d</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1444
|
+
<span class='id identifier rubyid_d'>d</span><span class='period'>.</span><span class='id identifier rubyid_set_hebrew_date'>set_hebrew_date</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
|
1445
|
+
<span class='id identifier rubyid_d'>d</span>
|
1446
|
+
<span class='kw'>end</span></pre>
|
1447
|
+
</td>
|
1448
|
+
</tr>
|
1449
|
+
</table>
|
1450
|
+
</div>
|
1451
|
+
|
1452
|
+
</div>
|
1453
|
+
|
1454
|
+
<div id="instance_method_details" class="method_details_list">
|
1455
|
+
<h2>Instance Method Details</h2>
|
1456
|
+
|
1457
|
+
|
1458
|
+
<div class="method_details first">
|
1459
|
+
<h3 class="signature first" id="back-instance_method">
|
1460
|
+
|
1461
|
+
- (<tt>void</tt>) <strong>back</strong>
|
1462
|
+
|
1463
|
+
|
1464
|
+
|
1465
|
+
|
1466
|
+
|
1467
|
+
</h3><div class="docstring">
|
1468
|
+
<div class="discussion">
|
1469
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1470
|
+
<p>Move back one day.</p>
|
1471
|
+
|
1472
|
+
|
1473
|
+
</div>
|
1474
|
+
</div>
|
1475
|
+
<div class="tags">
|
1476
|
+
|
1477
|
+
|
1478
|
+
</div><table class="source_code">
|
1479
|
+
<tr>
|
1480
|
+
<td>
|
1481
|
+
<pre class="lines">
|
1482
|
+
|
1483
|
+
|
1484
|
+
214
|
1485
|
+
215
|
1486
|
+
216
|
1487
|
+
217
|
1488
|
+
218
|
1489
|
+
219
|
1490
|
+
220
|
1491
|
+
221
|
1492
|
+
222
|
1493
|
+
223
|
1494
|
+
224
|
1495
|
+
225
|
1496
|
+
226
|
1497
|
+
227
|
1498
|
+
228
|
1499
|
+
229
|
1500
|
+
230
|
1501
|
+
231
|
1502
|
+
232
|
1503
|
+
233
|
1504
|
+
234
|
1505
|
+
235
|
1506
|
+
236
|
1507
|
+
237
|
1508
|
+
238
|
1509
|
+
239
|
1510
|
+
240
|
1511
|
+
241
|
1512
|
+
242
|
1513
|
+
243
|
1514
|
+
244
|
1515
|
+
245
|
1516
|
+
246
|
1517
|
+
247</pre>
|
1518
|
+
</td>
|
1519
|
+
<td>
|
1520
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 214</span>
|
1521
|
+
|
1522
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_back'>back</span>
|
1523
|
+
<span class='comment'># Change Gregorian date
|
1524
|
+
</span> <span class='kw'>if</span> <span class='ivar'>@date</span> <span class='op'>==</span> <span class='int'>1</span>
|
1525
|
+
<span class='kw'>if</span> <span class='ivar'>@month</span> <span class='op'>==</span> <span class='int'>1</span>
|
1526
|
+
<span class='ivar'>@month</span> <span class='op'>=</span> <span class='int'>12</span>
|
1527
|
+
<span class='ivar'>@year</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1528
|
+
<span class='kw'>else</span>
|
1529
|
+
<span class='ivar'>@month</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1530
|
+
<span class='kw'>end</span>
|
1531
|
+
|
1532
|
+
<span class='comment'># change to last day of previous month
|
1533
|
+
</span> <span class='ivar'>@date</span> <span class='op'>=</span> <span class='id identifier rubyid_last_day_of_month'>last_day_of_month</span>
|
1534
|
+
<span class='kw'>else</span>
|
1535
|
+
<span class='ivar'>@date</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1536
|
+
<span class='kw'>end</span>
|
1537
|
+
|
1538
|
+
<span class='comment'># Change Hebrew date
|
1539
|
+
</span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='int'>1</span>
|
1540
|
+
<span class='kw'>if</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># Nisan
|
1541
|
+
</span> <span class='ivar'>@hebrew_month</span> <span class='op'>=</span> <span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span>
|
1542
|
+
<span class='kw'>elsif</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>7</span> <span class='comment'># Rosh Hashana
|
1543
|
+
</span> <span class='ivar'>@hebrew_year</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1544
|
+
<span class='ivar'>@hebrew_month</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1545
|
+
<span class='kw'>else</span>
|
1546
|
+
<span class='ivar'>@hebrew_month</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1547
|
+
<span class='kw'>end</span>
|
1548
|
+
<span class='ivar'>@hebrew_date</span> <span class='op'>=</span> <span class='id identifier rubyid_last_day_of_hebrew_month'>last_day_of_hebrew_month</span>
|
1549
|
+
<span class='kw'>else</span>
|
1550
|
+
<span class='ivar'>@hebrew_date</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1551
|
+
<span class='kw'>end</span>
|
1552
|
+
|
1553
|
+
<span class='comment'># Change the absolute date
|
1554
|
+
</span> <span class='ivar'>@abs_date</span> <span class='op'>-=</span> <span class='int'>1</span>
|
1555
|
+
<span class='kw'>end</span></pre>
|
1556
|
+
</td>
|
1557
|
+
</tr>
|
1558
|
+
</table>
|
1559
|
+
</div>
|
1560
|
+
|
1561
|
+
<div class="method_details ">
|
1562
|
+
<h3 class="signature " id="clone-instance_method">
|
1563
|
+
|
1564
|
+
- (<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>) <strong>clone</strong>
|
1565
|
+
|
1566
|
+
|
1567
|
+
|
1568
|
+
|
1569
|
+
|
1570
|
+
</h3><div class="docstring">
|
1571
|
+
<div class="discussion">
|
1572
|
+
|
1573
|
+
<p>Get a clone of this object.</p>
|
1574
|
+
|
1575
|
+
|
1576
|
+
</div>
|
1577
|
+
</div>
|
1578
|
+
<div class="tags">
|
1579
|
+
|
1580
|
+
<p class="tag_title">Returns:</p>
|
1581
|
+
<ul class="return">
|
1582
|
+
|
1583
|
+
<li>
|
1584
|
+
|
1585
|
+
|
1586
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>)</span>
|
1587
|
+
|
1588
|
+
|
1589
|
+
|
1590
|
+
</li>
|
1591
|
+
|
1592
|
+
</ul>
|
1593
|
+
|
1594
|
+
</div><table class="source_code">
|
1595
|
+
<tr>
|
1596
|
+
<td>
|
1597
|
+
<pre class="lines">
|
1598
|
+
|
1599
|
+
|
1600
|
+
96
|
1601
|
+
97
|
1602
|
+
98</pre>
|
1603
|
+
</td>
|
1604
|
+
<td>
|
1605
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 96</span>
|
1606
|
+
|
1607
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_clone'>clone</span>
|
1608
|
+
<span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_date'>to_date</span><span class='rparen'>)</span>
|
1609
|
+
<span class='kw'>end</span></pre>
|
1610
|
+
</td>
|
1611
|
+
</tr>
|
1612
|
+
</table>
|
1613
|
+
</div>
|
1614
|
+
|
1615
|
+
<div class="method_details ">
|
1616
|
+
<h3 class="signature " id="day-instance_method">
|
1617
|
+
|
1618
|
+
- (<tt>Integer</tt>) <strong>day</strong>
|
1619
|
+
|
1620
|
+
|
1621
|
+
|
1622
|
+
|
1623
|
+
|
1624
|
+
</h3><div class="docstring">
|
1625
|
+
<div class="discussion">
|
1626
|
+
|
1627
|
+
<p>Get the day of the week.</p>
|
1628
|
+
|
1629
|
+
|
1630
|
+
</div>
|
1631
|
+
</div>
|
1632
|
+
<div class="tags">
|
1633
|
+
|
1634
|
+
<p class="tag_title">Returns:</p>
|
1635
|
+
<ul class="return">
|
1636
|
+
|
1637
|
+
<li>
|
1638
|
+
|
1639
|
+
|
1640
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1641
|
+
|
1642
|
+
|
1643
|
+
|
1644
|
+
—
|
1645
|
+
<div class='inline'>
|
1646
|
+
<p>the day of the week, 1-7.</p>
|
1647
|
+
</div>
|
1648
|
+
|
1649
|
+
</li>
|
1650
|
+
|
1651
|
+
</ul>
|
1652
|
+
|
1653
|
+
</div><table class="source_code">
|
1654
|
+
<tr>
|
1655
|
+
<td>
|
1656
|
+
<pre class="lines">
|
1657
|
+
|
1658
|
+
|
1659
|
+
292
|
1660
|
+
293
|
1661
|
+
294</pre>
|
1662
|
+
</td>
|
1663
|
+
<td>
|
1664
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 292</span>
|
1665
|
+
|
1666
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_day'>day</span>
|
1667
|
+
<span class='id identifier rubyid_to_date'>to_date</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%w</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>+</span> <span class='int'>1</span>
|
1668
|
+
<span class='kw'>end</span></pre>
|
1669
|
+
</td>
|
1670
|
+
</tr>
|
1671
|
+
</table>
|
1672
|
+
</div>
|
1673
|
+
|
1674
|
+
<div class="method_details ">
|
1675
|
+
<h3 class="signature " id="forward-instance_method">
|
1676
|
+
|
1677
|
+
- (<tt>void</tt>) <strong>forward</strong>
|
1678
|
+
|
1679
|
+
|
1680
|
+
|
1681
|
+
|
1682
|
+
|
1683
|
+
</h3><div class="docstring">
|
1684
|
+
<div class="discussion">
|
1685
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1686
|
+
<p>Move forward one day.</p>
|
1687
|
+
|
1688
|
+
|
1689
|
+
</div>
|
1690
|
+
</div>
|
1691
|
+
<div class="tags">
|
1692
|
+
|
1693
|
+
|
1694
|
+
</div><table class="source_code">
|
1695
|
+
<tr>
|
1696
|
+
<td>
|
1697
|
+
<pre class="lines">
|
1698
|
+
|
1699
|
+
|
1700
|
+
171
|
1701
|
+
172
|
1702
|
+
173
|
1703
|
+
174
|
1704
|
+
175
|
1705
|
+
176
|
1706
|
+
177
|
1707
|
+
178
|
1708
|
+
179
|
1709
|
+
180
|
1710
|
+
181
|
1711
|
+
182
|
1712
|
+
183
|
1713
|
+
184
|
1714
|
+
185
|
1715
|
+
186
|
1716
|
+
187
|
1717
|
+
188
|
1718
|
+
189
|
1719
|
+
190
|
1720
|
+
191
|
1721
|
+
192
|
1722
|
+
193
|
1723
|
+
194
|
1724
|
+
195
|
1725
|
+
196
|
1726
|
+
197
|
1727
|
+
198
|
1728
|
+
199
|
1729
|
+
200
|
1730
|
+
201
|
1731
|
+
202
|
1732
|
+
203
|
1733
|
+
204
|
1734
|
+
205
|
1735
|
+
206
|
1736
|
+
207
|
1737
|
+
208
|
1738
|
+
209
|
1739
|
+
210</pre>
|
1740
|
+
</td>
|
1741
|
+
<td>
|
1742
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 171</span>
|
1743
|
+
|
1744
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_forward'>forward</span>
|
1745
|
+
<span class='comment'># Change Gregorian date
|
1746
|
+
</span> <span class='kw'>if</span> <span class='ivar'>@date</span> <span class='op'>==</span> <span class='id identifier rubyid_last_day_of_month'>last_day_of_month</span>
|
1747
|
+
<span class='kw'>if</span> <span class='ivar'>@month</span> <span class='op'>==</span> <span class='int'>12</span>
|
1748
|
+
<span class='comment'># last day of year
|
1749
|
+
</span> <span class='ivar'>@year</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1750
|
+
<span class='ivar'>@month</span> <span class='op'>=</span> <span class='int'>1</span>
|
1751
|
+
<span class='ivar'>@date</span> <span class='op'>=</span> <span class='int'>1</span>
|
1752
|
+
<span class='kw'>else</span>
|
1753
|
+
<span class='ivar'>@month</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1754
|
+
<span class='ivar'>@date</span> <span class='op'>=</span> <span class='int'>1</span>
|
1755
|
+
<span class='kw'>end</span>
|
1756
|
+
<span class='kw'>else</span>
|
1757
|
+
<span class='comment'># if not last day of month
|
1758
|
+
</span> <span class='ivar'>@date</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1759
|
+
<span class='kw'>end</span>
|
1760
|
+
|
1761
|
+
<span class='comment'># Change Hebrew date
|
1762
|
+
</span> <span class='kw'>if</span> <span class='ivar'>@hebrew_date</span> <span class='op'>==</span> <span class='id identifier rubyid_last_day_of_hebrew_month'>last_day_of_hebrew_month</span>
|
1763
|
+
<span class='kw'>if</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='int'>6</span>
|
1764
|
+
<span class='comment'># last day of Elul (i.e. last day of Hebrew year)
|
1765
|
+
</span> <span class='ivar'>@hebrew_year</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1766
|
+
<span class='ivar'>@hebrew_month</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1767
|
+
<span class='ivar'>@hebrew_date</span> <span class='op'>=</span> <span class='int'>1</span>
|
1768
|
+
<span class='kw'>elsif</span> <span class='ivar'>@hebrew_month</span> <span class='op'>==</span> <span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span>
|
1769
|
+
<span class='comment'># last day of Adar or Adar II
|
1770
|
+
</span> <span class='ivar'>@hebrew_month</span> <span class='op'>=</span> <span class='int'>1</span>
|
1771
|
+
<span class='ivar'>@hebrew_date</span> <span class='op'>=</span> <span class='int'>1</span>
|
1772
|
+
<span class='kw'>else</span>
|
1773
|
+
<span class='ivar'>@hebrew_month</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1774
|
+
<span class='ivar'>@hebrew_date</span> <span class='op'>=</span> <span class='int'>1</span>
|
1775
|
+
<span class='kw'>end</span>
|
1776
|
+
<span class='kw'>else</span>
|
1777
|
+
<span class='comment'># not last day of month
|
1778
|
+
</span> <span class='ivar'>@hebrew_date</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1779
|
+
<span class='kw'>end</span>
|
1780
|
+
|
1781
|
+
<span class='comment'># increment the absolute date
|
1782
|
+
</span> <span class='ivar'>@abs_date</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1783
|
+
<span class='kw'>end</span></pre>
|
1784
|
+
</td>
|
1785
|
+
</tr>
|
1786
|
+
</table>
|
1787
|
+
</div>
|
1788
|
+
|
1789
|
+
<div class="method_details ">
|
1790
|
+
<h3 class="signature " id="hebrew_leap_year?-instance_method">
|
1791
|
+
|
1792
|
+
- (<tt>Boolean</tt>) <strong>hebrew_leap_year?</strong>(year = nil)
|
1793
|
+
|
1794
|
+
|
1795
|
+
|
1796
|
+
|
1797
|
+
|
1798
|
+
</h3><div class="docstring">
|
1799
|
+
<div class="discussion">
|
1800
|
+
|
1801
|
+
<p>Is this a Hebrew leap year?</p>
|
1802
|
+
|
1803
|
+
|
1804
|
+
</div>
|
1805
|
+
</div>
|
1806
|
+
<div class="tags">
|
1807
|
+
<p class="tag_title">Parameters:</p>
|
1808
|
+
<ul class="param">
|
1809
|
+
|
1810
|
+
<li>
|
1811
|
+
|
1812
|
+
<span class='name'>year</span>
|
1813
|
+
|
1814
|
+
|
1815
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1816
|
+
|
1817
|
+
|
1818
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1819
|
+
|
1820
|
+
|
1821
|
+
—
|
1822
|
+
<div class='inline'>
|
1823
|
+
<p>Used internally.</p>
|
1824
|
+
</div>
|
1825
|
+
|
1826
|
+
</li>
|
1827
|
+
|
1828
|
+
</ul>
|
1829
|
+
|
1830
|
+
<p class="tag_title">Returns:</p>
|
1831
|
+
<ul class="return">
|
1832
|
+
|
1833
|
+
<li>
|
1834
|
+
|
1835
|
+
|
1836
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1837
|
+
|
1838
|
+
|
1839
|
+
|
1840
|
+
</li>
|
1841
|
+
|
1842
|
+
</ul>
|
1843
|
+
|
1844
|
+
</div><table class="source_code">
|
1845
|
+
<tr>
|
1846
|
+
<td>
|
1847
|
+
<pre class="lines">
|
1848
|
+
|
1849
|
+
|
1850
|
+
319
|
1851
|
+
320
|
1852
|
+
321
|
1853
|
+
322</pre>
|
1854
|
+
</td>
|
1855
|
+
<td>
|
1856
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 319</span>
|
1857
|
+
|
1858
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
1859
|
+
<span class='id identifier rubyid_year'>year</span> <span class='op'>||=</span> <span class='ivar'>@hebrew_year</span>
|
1860
|
+
<span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>7</span> <span class='op'>*</span> <span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_remainder'>remainder</span><span class='lparen'>(</span><span class='int'>19</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'><</span> <span class='int'>7</span>
|
1861
|
+
<span class='kw'>end</span></pre>
|
1862
|
+
</td>
|
1863
|
+
</tr>
|
1864
|
+
</table>
|
1865
|
+
</div>
|
1866
|
+
|
1867
|
+
<div class="method_details ">
|
1868
|
+
<h3 class="signature " id="hebrew_month_to_s-instance_method">
|
1869
|
+
|
1870
|
+
- (<tt>String</tt>) <strong>hebrew_month_to_s</strong>
|
1871
|
+
|
1872
|
+
|
1873
|
+
|
1874
|
+
|
1875
|
+
|
1876
|
+
</h3><div class="docstring">
|
1877
|
+
<div class="discussion">
|
1878
|
+
|
1879
|
+
<p>Get the name of the current Hebrew month.</p>
|
1880
|
+
|
1881
|
+
|
1882
|
+
</div>
|
1883
|
+
</div>
|
1884
|
+
<div class="tags">
|
1885
|
+
|
1886
|
+
<p class="tag_title">Returns:</p>
|
1887
|
+
<ul class="return">
|
1888
|
+
|
1889
|
+
<li>
|
1890
|
+
|
1891
|
+
|
1892
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1893
|
+
|
1894
|
+
|
1895
|
+
|
1896
|
+
</li>
|
1897
|
+
|
1898
|
+
</ul>
|
1899
|
+
|
1900
|
+
</div><table class="source_code">
|
1901
|
+
<tr>
|
1902
|
+
<td>
|
1903
|
+
<pre class="lines">
|
1904
|
+
|
1905
|
+
|
1906
|
+
251
|
1907
|
+
252
|
1908
|
+
253
|
1909
|
+
254
|
1910
|
+
255
|
1911
|
+
256
|
1912
|
+
257</pre>
|
1913
|
+
</td>
|
1914
|
+
<td>
|
1915
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 251</span>
|
1916
|
+
|
1917
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span>
|
1918
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='const'>HEBREW_MONTH_NAMES</span><span class='lbracket'>[</span><span class='ivar'>@hebrew_month</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span>
|
1919
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Teves</span><span class='tstring_end'>'</span></span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@ashkenaz</span>
|
1920
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Tevet</span><span class='tstring_end'>'</span></span>
|
1921
|
+
<span class='kw'>end</span>
|
1922
|
+
<span class='id identifier rubyid_name'>name</span>
|
1923
|
+
<span class='kw'>end</span></pre>
|
1924
|
+
</td>
|
1925
|
+
</tr>
|
1926
|
+
</table>
|
1927
|
+
</div>
|
1928
|
+
|
1929
|
+
<div class="method_details ">
|
1930
|
+
<h3 class="signature " id="last_day_of_hebrew_month-instance_method">
|
1931
|
+
|
1932
|
+
- (<tt>Integer</tt>) <strong>last_day_of_hebrew_month</strong>(month = nil)
|
1933
|
+
|
1934
|
+
|
1935
|
+
|
1936
|
+
|
1937
|
+
|
1938
|
+
</h3><div class="docstring">
|
1939
|
+
<div class="discussion">
|
1940
|
+
|
1941
|
+
<p>Last day of the current Hebrew month.</p>
|
1942
|
+
|
1943
|
+
|
1944
|
+
</div>
|
1945
|
+
</div>
|
1946
|
+
<div class="tags">
|
1947
|
+
<p class="tag_title">Parameters:</p>
|
1948
|
+
<ul class="param">
|
1949
|
+
|
1950
|
+
<li>
|
1951
|
+
|
1952
|
+
<span class='name'>month</span>
|
1953
|
+
|
1954
|
+
|
1955
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1956
|
+
|
1957
|
+
|
1958
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1959
|
+
|
1960
|
+
|
1961
|
+
—
|
1962
|
+
<div class='inline'>
|
1963
|
+
<p>Used internally.</p>
|
1964
|
+
</div>
|
1965
|
+
|
1966
|
+
</li>
|
1967
|
+
|
1968
|
+
</ul>
|
1969
|
+
|
1970
|
+
<p class="tag_title">Returns:</p>
|
1971
|
+
<ul class="return">
|
1972
|
+
|
1973
|
+
<li>
|
1974
|
+
|
1975
|
+
|
1976
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1977
|
+
|
1978
|
+
|
1979
|
+
|
1980
|
+
</li>
|
1981
|
+
|
1982
|
+
</ul>
|
1983
|
+
|
1984
|
+
</div><table class="source_code">
|
1985
|
+
<tr>
|
1986
|
+
<td>
|
1987
|
+
<pre class="lines">
|
1988
|
+
|
1989
|
+
|
1990
|
+
333
|
1991
|
+
334
|
1992
|
+
335
|
1993
|
+
336
|
1994
|
+
337
|
1995
|
+
338
|
1996
|
+
339
|
1997
|
+
340
|
1998
|
+
341
|
1999
|
+
342
|
2000
|
+
343
|
2001
|
+
344
|
2002
|
+
345
|
2003
|
+
346
|
2004
|
+
347</pre>
|
2005
|
+
</td>
|
2006
|
+
<td>
|
2007
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 333</span>
|
2008
|
+
|
2009
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_last_day_of_hebrew_month'>last_day_of_hebrew_month</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
2010
|
+
<span class='id identifier rubyid_month'>month</span> <span class='op'>||=</span> <span class='ivar'>@hebrew_month</span>
|
2011
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>2</span> <span class='op'>||</span>
|
2012
|
+
<span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>4</span> <span class='op'>||</span>
|
2013
|
+
<span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>6</span> <span class='op'>||</span>
|
2014
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>8</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid__cheshvan_long?'>_cheshvan_long?</span><span class='rparen'>)</span> <span class='op'>||</span>
|
2015
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>9</span> <span class='op'>&&</span> <span class='id identifier rubyid__kislev_short?'>_kislev_short?</span><span class='rparen'>)</span> <span class='op'>||</span>
|
2016
|
+
<span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>10</span> <span class='op'>||</span>
|
2017
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>12</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span><span class='rparen'>)</span> <span class='op'>||</span>
|
2018
|
+
<span class='id identifier rubyid_month'>month</span> <span class='op'>==</span> <span class='int'>13</span>
|
2019
|
+
<span class='int'>29</span>
|
2020
|
+
<span class='kw'>else</span>
|
2021
|
+
<span class='int'>30</span>
|
2022
|
+
<span class='kw'>end</span>
|
2023
|
+
<span class='kw'>end</span></pre>
|
2024
|
+
</td>
|
2025
|
+
</tr>
|
2026
|
+
</table>
|
2027
|
+
</div>
|
2028
|
+
|
2029
|
+
<div class="method_details ">
|
2030
|
+
<h3 class="signature " id="last_day_of_month-instance_method">
|
2031
|
+
|
2032
|
+
- (<tt>Integer</tt>) <strong>last_day_of_month</strong>(month = nil)
|
2033
|
+
|
2034
|
+
|
2035
|
+
|
2036
|
+
|
2037
|
+
|
2038
|
+
</h3><div class="docstring">
|
2039
|
+
<div class="discussion">
|
2040
|
+
|
2041
|
+
<p>The last day of the Gregorian month.</p>
|
2042
|
+
|
2043
|
+
|
2044
|
+
</div>
|
2045
|
+
</div>
|
2046
|
+
<div class="tags">
|
2047
|
+
<p class="tag_title">Parameters:</p>
|
2048
|
+
<ul class="param">
|
2049
|
+
|
2050
|
+
<li>
|
2051
|
+
|
2052
|
+
<span class='name'>month</span>
|
2053
|
+
|
2054
|
+
|
2055
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2056
|
+
|
2057
|
+
|
2058
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
2059
|
+
|
2060
|
+
|
2061
|
+
—
|
2062
|
+
<div class='inline'>
|
2063
|
+
<p>Used internally.</p>
|
2064
|
+
</div>
|
2065
|
+
|
2066
|
+
</li>
|
2067
|
+
|
2068
|
+
</ul>
|
2069
|
+
|
2070
|
+
<p class="tag_title">Returns:</p>
|
2071
|
+
<ul class="return">
|
2072
|
+
|
2073
|
+
<li>
|
2074
|
+
|
2075
|
+
|
2076
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2077
|
+
|
2078
|
+
|
2079
|
+
|
2080
|
+
</li>
|
2081
|
+
|
2082
|
+
</ul>
|
2083
|
+
|
2084
|
+
</div><table class="source_code">
|
2085
|
+
<tr>
|
2086
|
+
<td>
|
2087
|
+
<pre class="lines">
|
2088
|
+
|
2089
|
+
|
2090
|
+
299
|
2091
|
+
300
|
2092
|
+
301
|
2093
|
+
302
|
2094
|
+
303
|
2095
|
+
304
|
2096
|
+
305
|
2097
|
+
306
|
2098
|
+
307
|
2099
|
+
308
|
2100
|
+
309
|
2101
|
+
310
|
2102
|
+
311
|
2103
|
+
312
|
2104
|
+
313
|
2105
|
+
314</pre>
|
2106
|
+
</td>
|
2107
|
+
<td>
|
2108
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 299</span>
|
2109
|
+
|
2110
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_last_day_of_month'>last_day_of_month</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
2111
|
+
<span class='id identifier rubyid_month'>month</span> <span class='op'>||=</span> <span class='ivar'>@month</span>
|
2112
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_month'>month</span>
|
2113
|
+
<span class='kw'>when</span> <span class='int'>2</span>
|
2114
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='period'>.</span><span class='id identifier rubyid_remainder'>remainder</span><span class='lparen'>(</span><span class='int'>4</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='int'>0</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='period'>.</span><span class='id identifier rubyid_remainder'>remainder</span><span class='lparen'>(</span><span class='int'>100</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='int'>0</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>||</span>
|
2115
|
+
<span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='period'>.</span><span class='id identifier rubyid_remainder'>remainder</span><span class='lparen'>(</span><span class='int'>400</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='int'>0</span><span class='rparen'>)</span>
|
2116
|
+
<span class='int'>29</span>
|
2117
|
+
<span class='kw'>else</span>
|
2118
|
+
<span class='int'>28</span>
|
2119
|
+
<span class='kw'>end</span>
|
2120
|
+
<span class='kw'>when</span> <span class='int'>4</span><span class='comma'>,</span> <span class='int'>6</span><span class='comma'>,</span> <span class='int'>9</span><span class='comma'>,</span> <span class='int'>11</span>
|
2121
|
+
<span class='int'>30</span>
|
2122
|
+
<span class='kw'>else</span>
|
2123
|
+
<span class='int'>31</span>
|
2124
|
+
<span class='kw'>end</span>
|
2125
|
+
<span class='kw'>end</span></pre>
|
2126
|
+
</td>
|
2127
|
+
</tr>
|
2128
|
+
</table>
|
2129
|
+
</div>
|
2130
|
+
|
2131
|
+
<div class="method_details ">
|
2132
|
+
<h3 class="signature " id="last_month_of_hebrew_year-instance_method">
|
2133
|
+
|
2134
|
+
- (<tt>Integer</tt>) <strong>last_month_of_hebrew_year</strong>
|
2135
|
+
|
2136
|
+
|
2137
|
+
|
2138
|
+
|
2139
|
+
|
2140
|
+
</h3><div class="docstring">
|
2141
|
+
<div class="discussion">
|
2142
|
+
|
2143
|
+
<p>The last month in this Hebrew year (12 or 13).</p>
|
2144
|
+
|
2145
|
+
|
2146
|
+
</div>
|
2147
|
+
</div>
|
2148
|
+
<div class="tags">
|
2149
|
+
|
2150
|
+
<p class="tag_title">Returns:</p>
|
2151
|
+
<ul class="return">
|
2152
|
+
|
2153
|
+
<li>
|
2154
|
+
|
2155
|
+
|
2156
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2157
|
+
|
2158
|
+
|
2159
|
+
|
2160
|
+
</li>
|
2161
|
+
|
2162
|
+
</ul>
|
2163
|
+
|
2164
|
+
</div><table class="source_code">
|
2165
|
+
<tr>
|
2166
|
+
<td>
|
2167
|
+
<pre class="lines">
|
2168
|
+
|
2169
|
+
|
2170
|
+
326
|
2171
|
+
327
|
2172
|
+
328</pre>
|
2173
|
+
</td>
|
2174
|
+
<td>
|
2175
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 326</span>
|
2176
|
+
|
2177
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span>
|
2178
|
+
<span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span> <span class='op'>?</span> <span class='int'>13</span> <span class='op'>:</span> <span class='int'>12</span>
|
2179
|
+
<span class='kw'>end</span></pre>
|
2180
|
+
</td>
|
2181
|
+
</tr>
|
2182
|
+
</table>
|
2183
|
+
</div>
|
2184
|
+
|
2185
|
+
<div class="method_details ">
|
2186
|
+
<h3 class="signature " id="set_date-instance_method">
|
2187
|
+
|
2188
|
+
- (<tt>void</tt>) <strong>set_date</strong>(year, month, date)
|
2189
|
+
|
2190
|
+
|
2191
|
+
|
2192
|
+
|
2193
|
+
|
2194
|
+
</h3><div class="docstring">
|
2195
|
+
<div class="discussion">
|
2196
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2197
|
+
<p>Set the Gregorian date of this HebrewDate.</p>
|
2198
|
+
|
2199
|
+
|
2200
|
+
</div>
|
2201
|
+
</div>
|
2202
|
+
<div class="tags">
|
2203
|
+
<p class="tag_title">Parameters:</p>
|
2204
|
+
<ul class="param">
|
2205
|
+
|
2206
|
+
<li>
|
2207
|
+
|
2208
|
+
<span class='name'>year</span>
|
2209
|
+
|
2210
|
+
|
2211
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2212
|
+
|
2213
|
+
|
2214
|
+
|
2215
|
+
—
|
2216
|
+
<div class='inline'>
|
2217
|
+
<p>the Gregorian year (e.g. 2004)</p>
|
2218
|
+
</div>
|
2219
|
+
|
2220
|
+
</li>
|
2221
|
+
|
2222
|
+
<li>
|
2223
|
+
|
2224
|
+
<span class='name'>month</span>
|
2225
|
+
|
2226
|
+
|
2227
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2228
|
+
|
2229
|
+
|
2230
|
+
|
2231
|
+
—
|
2232
|
+
<div class='inline'>
|
2233
|
+
<p>the Gregorian month (1-12)</p>
|
2234
|
+
</div>
|
2235
|
+
|
2236
|
+
</li>
|
2237
|
+
|
2238
|
+
<li>
|
2239
|
+
|
2240
|
+
<span class='name'>date</span>
|
2241
|
+
|
2242
|
+
|
2243
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2244
|
+
|
2245
|
+
|
2246
|
+
|
2247
|
+
—
|
2248
|
+
<div class='inline'>
|
2249
|
+
<p>the Gregorian day of month (1-31)</p>
|
2250
|
+
</div>
|
2251
|
+
|
2252
|
+
</li>
|
2253
|
+
|
2254
|
+
</ul>
|
2255
|
+
|
2256
|
+
|
2257
|
+
</div><table class="source_code">
|
2258
|
+
<tr>
|
2259
|
+
<td>
|
2260
|
+
<pre class="lines">
|
2261
|
+
|
2262
|
+
|
2263
|
+
115
|
2264
|
+
116
|
2265
|
+
117
|
2266
|
+
118
|
2267
|
+
119
|
2268
|
+
120
|
2269
|
+
121
|
2270
|
+
122
|
2271
|
+
123
|
2272
|
+
124
|
2273
|
+
125
|
2274
|
+
126
|
2275
|
+
127
|
2276
|
+
128
|
2277
|
+
129
|
2278
|
+
130
|
2279
|
+
131
|
2280
|
+
132
|
2281
|
+
133</pre>
|
2282
|
+
</td>
|
2283
|
+
<td>
|
2284
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 115</span>
|
2285
|
+
|
2286
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_date'>set_date</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
|
2287
|
+
<span class='comment'># precond should be 1->12 anyways, but just in case...
|
2288
|
+
</span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Illegal value for year: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_year'>year</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_year'>year</span> <span class='op'><</span> <span class='int'>0</span>
|
2289
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Illegal value for month: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_month'>month</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_month'>month</span> <span class='op'>></span> <span class='int'>12</span> <span class='op'>||</span> <span class='id identifier rubyid_month'>month</span> <span class='op'><</span> <span class='int'>0</span>
|
2290
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Illegal value for date: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_date'>date</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_date'>date</span> <span class='op'><</span> <span class='int'>0</span>
|
2291
|
+
|
2292
|
+
<span class='comment'># make sure date is a valid date for the given month.
|
2293
|
+
</span> <span class='comment'># If not, set to last day of month
|
2294
|
+
</span> <span class='id identifier rubyid_last_day'>last_day</span> <span class='op'>=</span> <span class='id identifier rubyid_last_day_of_month'>last_day_of_month</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='rparen'>)</span>
|
2295
|
+
<span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='id identifier rubyid_last_day'>last_day</span> <span class='kw'>if</span> <span class='id identifier rubyid_date'>date</span> <span class='op'>></span> <span class='id identifier rubyid_last_day'>last_day</span>
|
2296
|
+
|
2297
|
+
<span class='ivar'>@year</span> <span class='op'>=</span> <span class='id identifier rubyid_year'>year</span>
|
2298
|
+
<span class='ivar'>@month</span> <span class='op'>=</span> <span class='id identifier rubyid_month'>month</span>
|
2299
|
+
<span class='ivar'>@date</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span>
|
2300
|
+
|
2301
|
+
<span class='comment'># init the Hebrew date
|
2302
|
+
</span> <span class='ivar'>@abs_date</span> <span class='op'>=</span> <span class='id identifier rubyid__date_to_abs_date'>_date_to_abs_date</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='comma'>,</span> <span class='ivar'>@month</span><span class='comma'>,</span> <span class='ivar'>@date</span><span class='rparen'>)</span>
|
2303
|
+
<span class='id identifier rubyid__abs_date_to_hebrew_date!'>_abs_date_to_hebrew_date!</span>
|
2304
|
+
<span class='kw'>end</span></pre>
|
2305
|
+
</td>
|
2306
|
+
</tr>
|
2307
|
+
</table>
|
2308
|
+
</div>
|
2309
|
+
|
2310
|
+
<div class="method_details ">
|
2311
|
+
<h3 class="signature " id="set_hebrew_date-instance_method">
|
2312
|
+
|
2313
|
+
- (<tt>void</tt>) <strong>set_hebrew_date</strong>(year, month, date)
|
2314
|
+
|
2315
|
+
|
2316
|
+
|
2317
|
+
|
2318
|
+
|
2319
|
+
</h3><div class="docstring">
|
2320
|
+
<div class="discussion">
|
2321
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2322
|
+
<p>Set the Hebrew date.</p>
|
2323
|
+
|
2324
|
+
|
2325
|
+
</div>
|
2326
|
+
</div>
|
2327
|
+
<div class="tags">
|
2328
|
+
<p class="tag_title">Parameters:</p>
|
2329
|
+
<ul class="param">
|
2330
|
+
|
2331
|
+
<li>
|
2332
|
+
|
2333
|
+
<span class='name'>year</span>
|
2334
|
+
|
2335
|
+
|
2336
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2337
|
+
|
2338
|
+
|
2339
|
+
|
2340
|
+
—
|
2341
|
+
<div class='inline'>
|
2342
|
+
<p>the Hebrew year (e.g. 2008)</p>
|
2343
|
+
</div>
|
2344
|
+
|
2345
|
+
</li>
|
2346
|
+
|
2347
|
+
<li>
|
2348
|
+
|
2349
|
+
<span class='name'>month</span>
|
2350
|
+
|
2351
|
+
|
2352
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2353
|
+
|
2354
|
+
|
2355
|
+
|
2356
|
+
—
|
2357
|
+
<div class='inline'>
|
2358
|
+
<p>the Hebrew month (1-13)</p>
|
2359
|
+
</div>
|
2360
|
+
|
2361
|
+
</li>
|
2362
|
+
|
2363
|
+
<li>
|
2364
|
+
|
2365
|
+
<span class='name'>date</span>
|
2366
|
+
|
2367
|
+
|
2368
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2369
|
+
|
2370
|
+
|
2371
|
+
|
2372
|
+
—
|
2373
|
+
<div class='inline'>
|
2374
|
+
<p>the Hebrew day of month (1-30)</p>
|
2375
|
+
</div>
|
2376
|
+
|
2377
|
+
</li>
|
2378
|
+
|
2379
|
+
</ul>
|
2380
|
+
|
2381
|
+
|
2382
|
+
</div><table class="source_code">
|
2383
|
+
<tr>
|
2384
|
+
<td>
|
2385
|
+
<pre class="lines">
|
2386
|
+
|
2387
|
+
|
2388
|
+
140
|
2389
|
+
141
|
2390
|
+
142
|
2391
|
+
143
|
2392
|
+
144
|
2393
|
+
145
|
2394
|
+
146
|
2395
|
+
147
|
2396
|
+
148
|
2397
|
+
149
|
2398
|
+
150
|
2399
|
+
151
|
2400
|
+
152
|
2401
|
+
153
|
2402
|
+
154
|
2403
|
+
155
|
2404
|
+
156
|
2405
|
+
157
|
2406
|
+
158
|
2407
|
+
159
|
2408
|
+
160
|
2409
|
+
161</pre>
|
2410
|
+
</td>
|
2411
|
+
<td>
|
2412
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 140</span>
|
2413
|
+
|
2414
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_hebrew_date'>set_hebrew_date</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
|
2415
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Illegal value for Hebrew year: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_year'>year</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_year'>year</span> <span class='op'><</span> <span class='int'>0</span>
|
2416
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_month'>month</span> <span class='op'><</span> <span class='int'>0</span> <span class='op'>||</span> <span class='id identifier rubyid_month'>month</span> <span class='op'>></span> <span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span>
|
2417
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Illegal value for Hebrew month: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_month'>month</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
2418
|
+
<span class='kw'>end</span>
|
2419
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Illegal value for Hebrew date: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_date'>date</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_date'>date</span> <span class='op'><</span> <span class='int'>0</span>
|
2420
|
+
|
2421
|
+
<span class='comment'># make sure date is valid for this month;
|
2422
|
+
</span> <span class='comment'># otherwise, set to last day of month
|
2423
|
+
</span> <span class='id identifier rubyid_last_day'>last_day</span> <span class='op'>=</span> <span class='id identifier rubyid_last_day_of_hebrew_month'>last_day_of_hebrew_month</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='rparen'>)</span>
|
2424
|
+
<span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='id identifier rubyid_last_day'>last_day</span> <span class='kw'>if</span> <span class='id identifier rubyid_date'>date</span> <span class='op'>></span> <span class='id identifier rubyid_last_day'>last_day</span>
|
2425
|
+
|
2426
|
+
<span class='ivar'>@hebrew_year</span> <span class='op'>=</span> <span class='id identifier rubyid_year'>year</span>
|
2427
|
+
<span class='ivar'>@hebrew_month</span> <span class='op'>=</span> <span class='id identifier rubyid_month'>month</span>
|
2428
|
+
<span class='ivar'>@hebrew_date</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span>
|
2429
|
+
|
2430
|
+
<span class='comment'># reset gregorian date
|
2431
|
+
</span> <span class='ivar'>@abs_date</span> <span class='op'>=</span>
|
2432
|
+
<span class='id identifier rubyid__hebrew_date_to_abs_date'>_hebrew_date_to_abs_date</span><span class='lparen'>(</span><span class='ivar'>@hebrew_year</span><span class='comma'>,</span> <span class='ivar'>@hebrew_month</span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='rparen'>)</span>
|
2433
|
+
<span class='id identifier rubyid__abs_date_to_date!'>_abs_date_to_date!</span>
|
2434
|
+
|
2435
|
+
<span class='kw'>end</span></pre>
|
2436
|
+
</td>
|
2437
|
+
</tr>
|
2438
|
+
</table>
|
2439
|
+
</div>
|
2440
|
+
|
2441
|
+
<div class="method_details ">
|
2442
|
+
<h3 class="signature " id="strftime-instance_method">
|
2443
|
+
|
2444
|
+
- (<tt>String</tt>) <strong>strftime</strong>(format)
|
2445
|
+
|
2446
|
+
|
2447
|
+
|
2448
|
+
|
2449
|
+
|
2450
|
+
</h3><div class="docstring">
|
2451
|
+
<div class="discussion">
|
2452
|
+
|
2453
|
+
<p>Extend the Date strftime method by replacing Hebrew fields. You can denote
|
2454
|
+
Hebrew fields by using the * flag. Supported flags are:</p>
|
2455
|
+
|
2456
|
+
<pre class="code ruby"><code class="ruby">* %*Y - Hebrew year
|
2457
|
+
* %*m - Hebrew month, zero-padded
|
2458
|
+
* %*_m - Hebrew month, blank-padded
|
2459
|
+
* %*-m - Hebrew month, no-padded
|
2460
|
+
* %*B - Hebrew month, full name
|
2461
|
+
* %*^B - Hebrew month, full name uppercase
|
2462
|
+
* %*b - Hebrew month, 3 letters
|
2463
|
+
* %*^b - Hebrew month, 3 letters uppercase
|
2464
|
+
* %*h - same as %*b
|
2465
|
+
* %*d - Hebrew day of month, zero-padded
|
2466
|
+
* %*-d - Hebrew day of month, no-padded
|
2467
|
+
* %*e - Hebrew day of month, blank-padded</code></pre>
|
2468
|
+
|
2469
|
+
|
2470
|
+
</div>
|
2471
|
+
</div>
|
2472
|
+
<div class="tags">
|
2473
|
+
<p class="tag_title">Parameters:</p>
|
2474
|
+
<ul class="param">
|
2475
|
+
|
2476
|
+
<li>
|
2477
|
+
|
2478
|
+
<span class='name'>format</span>
|
2479
|
+
|
2480
|
+
|
2481
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2482
|
+
|
2483
|
+
|
2484
|
+
|
2485
|
+
</li>
|
2486
|
+
|
2487
|
+
</ul>
|
2488
|
+
|
2489
|
+
<p class="tag_title">Returns:</p>
|
2490
|
+
<ul class="return">
|
2491
|
+
|
2492
|
+
<li>
|
2493
|
+
|
2494
|
+
|
2495
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2496
|
+
|
2497
|
+
|
2498
|
+
|
2499
|
+
</li>
|
2500
|
+
|
2501
|
+
</ul>
|
2502
|
+
|
2503
|
+
</div><table class="source_code">
|
2504
|
+
<tr>
|
2505
|
+
<td>
|
2506
|
+
<pre class="lines">
|
2507
|
+
|
2508
|
+
|
2509
|
+
275
|
2510
|
+
276
|
2511
|
+
277
|
2512
|
+
278
|
2513
|
+
279
|
2514
|
+
280
|
2515
|
+
281
|
2516
|
+
282
|
2517
|
+
283
|
2518
|
+
284
|
2519
|
+
285
|
2520
|
+
286
|
2521
|
+
287
|
2522
|
+
288</pre>
|
2523
|
+
</td>
|
2524
|
+
<td>
|
2525
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 275</span>
|
2526
|
+
|
2527
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
|
2528
|
+
<span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*Y</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_year</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>
|
2529
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*m</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_month</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
|
2530
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*_m</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_month</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
|
2531
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*-m</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_month</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>
|
2532
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*B</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='rparen'>)</span><span class='period'>
|
2533
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*^B</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rparen'>)</span><span class='period'>
|
2534
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*b</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>
|
2535
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*^b</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rparen'>)</span><span class='period'>
|
2536
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*h</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>
|
2537
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
|
2538
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*-d</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>
|
2539
|
+
</span><span class='id identifier rubyid_ .gsub!'> .gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%*e</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
2540
|
+
<span class='kw'>end</span></pre>
|
2541
|
+
</td>
|
2542
|
+
</tr>
|
2543
|
+
</table>
|
2544
|
+
</div>
|
2545
|
+
|
2546
|
+
<div class="method_details ">
|
2547
|
+
<h3 class="signature " id="to_date-instance_method">
|
2548
|
+
|
2549
|
+
- (<tt>Date</tt>) <strong>to_date</strong>
|
2550
|
+
|
2551
|
+
|
2552
|
+
|
2553
|
+
|
2554
|
+
|
2555
|
+
</h3><div class="docstring">
|
2556
|
+
<div class="discussion">
|
2557
|
+
|
2558
|
+
<p>Return a Ruby Date corresponding to the Gregorian date.</p>
|
2559
|
+
|
2560
|
+
|
2561
|
+
</div>
|
2562
|
+
</div>
|
2563
|
+
<div class="tags">
|
2564
|
+
|
2565
|
+
<p class="tag_title">Returns:</p>
|
2566
|
+
<ul class="return">
|
2567
|
+
|
2568
|
+
<li>
|
2569
|
+
|
2570
|
+
|
2571
|
+
<span class='type'>(<tt>Date</tt>)</span>
|
2572
|
+
|
2573
|
+
|
2574
|
+
|
2575
|
+
</li>
|
2576
|
+
|
2577
|
+
</ul>
|
2578
|
+
|
2579
|
+
</div><table class="source_code">
|
2580
|
+
<tr>
|
2581
|
+
<td>
|
2582
|
+
<pre class="lines">
|
2583
|
+
|
2584
|
+
|
2585
|
+
165
|
2586
|
+
166
|
2587
|
+
167</pre>
|
2588
|
+
</td>
|
2589
|
+
<td>
|
2590
|
+
<pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 165</span>
|
2591
|
+
|
2592
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_date'>to_date</span>
|
2593
|
+
<span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='comma'>,</span> <span class='ivar'>@month</span><span class='comma'>,</span> <span class='ivar'>@date</span><span class='rparen'>)</span>
|
2594
|
+
<span class='kw'>end</span></pre>
|
2595
|
+
</td>
|
2596
|
+
</tr>
|
2597
|
+
</table>
|
2598
|
+
</div>
|
2599
|
+
|
2600
|
+
</div>
|
2601
|
+
|
2602
|
+
</div>
|
2603
|
+
|
2604
|
+
<div id="footer">
|
2605
|
+
Generated on Thu Jan 16 19:44:45 2014 by
|
2606
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2607
|
+
0.8.7.3 (ruby-2.0.0).
|
2608
|
+
</div>
|
2609
|
+
|
2610
|
+
</body>
|
2611
|
+
</html>
|