Class: Zmanim::ZmanimCalendar
Constant Summary
collapse
- ZENITH_16_POINT_1 =
GEOMETRIC_ZENITH + 16.1
- ZENITH_8_POINT_5 =
GEOMETRIC_ZENITH + 8.5
AstronomicalCalendar::ASTRONOMICAL_ZENITH, AstronomicalCalendar::CIVIL_ZENITH, AstronomicalCalendar::GEOMETRIC_ZENITH, AstronomicalCalendar::HOUR_MILLIS, AstronomicalCalendar::MINUTE_MILLIS, AstronomicalCalendar::NAUTICAL_ZENITH
Instance Attribute Summary collapse
#astronomical_calculator, #date, #geo_location
Instance Method Summary
collapse
#sea_level_sunrise, #sea_level_sunset, #sun_transit, #sunrise, #sunrise_offset_by_degrees, #sunset, #sunset_offset_by_degrees, #temporal_hour, #utc_sea_level_sunrise, #utc_sea_level_sunset, #utc_sunrise, #utc_sunset
Constructor Details
12
13
14
15
16
|
# File 'lib/zmanim/zmanim_calendar.rb', line 12
def initialize(opts={})
super
@candle_lighting_offset = opts[:candle_lighting_offset] || 18
@use_elevation = false
end
|
Instance Attribute Details
#candle_lighting_offset ⇒ Object
Returns the value of attribute candle_lighting_offset.
6
7
8
|
# File 'lib/zmanim/zmanim_calendar.rb', line 6
def candle_lighting_offset
@candle_lighting_offset
end
|
#use_elevation=(value) ⇒ Object
Sets the attribute use_elevation
7
8
9
|
# File 'lib/zmanim/zmanim_calendar.rb', line 7
def use_elevation=(value)
@use_elevation = value
end
|
Instance Method Details
#alos(opts = {degrees: 16.1}) ⇒ Object
46
47
48
49
50
51
52
53
54
|
# File 'lib/zmanim/zmanim_calendar.rb', line 46
def alos(opts={degrees: 16.1})
degrees, offset, zmanis_offset = (opts)
sunrise_for_degrees = degrees == 0 ? elevation_adjusted_sunrise : sunrise_offset_by_degrees(GEOMETRIC_ZENITH + degrees)
if zmanis_offset != 0
offset_by_minutes_zmanis(sunrise_for_degrees, -zmanis_offset)
else
offset_by_minutes(sunrise_for_degrees, -offset)
end
end
|
#alos_72 ⇒ Object
56
57
58
|
# File 'lib/zmanim/zmanim_calendar.rb', line 56
def alos_72
alos(offset: 72)
end
|
#assur_bemelacha?(current_time, tzais: tzais(), in_israel: false) ⇒ Boolean
119
120
121
122
123
124
125
|
# File 'lib/zmanim/zmanim_calendar.rb', line 119
def assur_bemelacha?(current_time, tzais: tzais(), in_israel: false)
tzais_time = tzais.is_a?(Hash) ? self.tzais(tzais) : tzais
jewish_calendar = HebrewCalendar::JewishCalendar.new(current_time.to_date)
jewish_calendar.in_israel = in_israel
(current_time.to_datetime <= tzais_time && jewish_calendar.assur_bemelacha?) ||
(current_time.to_datetime >= elevation_adjusted_sunset && jewish_calendar.tomorrow_assur_bemelacha?)
end
|
#candle_lighting ⇒ Object
74
75
76
|
# File 'lib/zmanim/zmanim_calendar.rb', line 74
def candle_lighting
offset_by_minutes(sea_level_sunset , -candle_lighting_offset)
end
|
#elevation_adjusted_sunrise ⇒ Object
Also known as:
hanetz
22
23
24
|
# File 'lib/zmanim/zmanim_calendar.rb', line 22
def elevation_adjusted_sunrise
use_elevation? ? sunrise : sea_level_sunrise
end
|
#elevation_adjusted_sunset ⇒ Object
Also known as:
shkia
27
28
29
|
# File 'lib/zmanim/zmanim_calendar.rb', line 27
def elevation_adjusted_sunset
use_elevation? ? sunset : sea_level_sunset
end
|
#mincha_gedola(day_start = elevation_adjusted_sunrise, day_end = elevation_adjusted_sunset) ⇒ Object
90
91
92
|
# File 'lib/zmanim/zmanim_calendar.rb', line 90
def mincha_gedola(day_start=elevation_adjusted_sunrise, day_end=elevation_adjusted_sunset)
shaos_into_day(day_start, day_end, 6.5)
end
|
#mincha_ketana(day_start = elevation_adjusted_sunrise, day_end = elevation_adjusted_sunset) ⇒ Object
94
95
96
|
# File 'lib/zmanim/zmanim_calendar.rb', line 94
def mincha_ketana(day_start=elevation_adjusted_sunrise, day_end=elevation_adjusted_sunset)
shaos_into_day(day_start, day_end, 9.5)
end
|
#plag_hamincha(day_start = elevation_adjusted_sunrise, day_end = elevation_adjusted_sunset) ⇒ Object
98
99
100
|
# File 'lib/zmanim/zmanim_calendar.rb', line 98
def plag_hamincha(day_start=elevation_adjusted_sunrise, day_end=elevation_adjusted_sunset)
shaos_into_day(day_start, day_end, 10.75)
end
|
#shaah_zmanis(day_start, day_end) ⇒ Object
102
103
104
|
# File 'lib/zmanim/zmanim_calendar.rb', line 102
def shaah_zmanis(day_start, day_end)
temporal_hour(day_start, day_end)
end
|
#shaah_zmanis_by_degrees_and_offset(degrees, offset) ⇒ Object
114
115
116
117
|
# File 'lib/zmanim/zmanim_calendar.rb', line 114
def shaah_zmanis_by_degrees_and_offset(degrees, offset)
opts = {degrees: degrees, offset: offset}
shaah_zmanis(alos(opts), tzais(opts))
end
|
#shaah_zmanis_gra ⇒ Object
106
107
108
|
# File 'lib/zmanim/zmanim_calendar.rb', line 106
def shaah_zmanis_gra
shaah_zmanis(elevation_adjusted_sunrise, elevation_adjusted_sunset)
end
|
#shaah_zmanis_mga ⇒ Object
110
111
112
|
# File 'lib/zmanim/zmanim_calendar.rb', line 110
def shaah_zmanis_mga
shaah_zmanis(alos_72, tzais_72)
end
|
#sof_zman_shma(day_start, day_end) ⇒ Object
62
63
64
|
# File 'lib/zmanim/zmanim_calendar.rb', line 62
def sof_zman_shma(day_start, day_end)
shaos_into_day(day_start, day_end, 3)
end
|
#sof_zman_shma_gra ⇒ Object
66
67
68
|
# File 'lib/zmanim/zmanim_calendar.rb', line 66
def sof_zman_shma_gra
sof_zman_shma(elevation_adjusted_sunrise, elevation_adjusted_sunset)
end
|
#sof_zman_shma_mga ⇒ Object
70
71
72
|
# File 'lib/zmanim/zmanim_calendar.rb', line 70
def sof_zman_shma_mga
sof_zman_shma(alos_72, tzais_72)
end
|
#sof_zman_tfila(day_start, day_end) ⇒ Object
78
79
80
|
# File 'lib/zmanim/zmanim_calendar.rb', line 78
def sof_zman_tfila(day_start, day_end)
shaos_into_day(day_start, day_end, 4)
end
|
#sof_zman_tfila_gra ⇒ Object
82
83
84
|
# File 'lib/zmanim/zmanim_calendar.rb', line 82
def sof_zman_tfila_gra
sof_zman_tfila(elevation_adjusted_sunrise, elevation_adjusted_sunset)
end
|
#sof_zman_tfila_mga ⇒ Object
86
87
88
|
# File 'lib/zmanim/zmanim_calendar.rb', line 86
def sof_zman_tfila_mga
sof_zman_tfila(alos_72, tzais_72)
end
|
#tzais(opts = {degrees: 8.5}) ⇒ Object
32
33
34
35
36
37
38
39
40
|
# File 'lib/zmanim/zmanim_calendar.rb', line 32
def tzais(opts={degrees: 8.5})
degrees, offset, zmanis_offset = (opts)
sunset_for_degrees = degrees == 0 ? elevation_adjusted_sunset : sunset_offset_by_degrees(GEOMETRIC_ZENITH + degrees)
if zmanis_offset != 0
offset_by_minutes_zmanis(sunset_for_degrees, zmanis_offset)
else
offset_by_minutes(sunset_for_degrees, offset)
end
end
|
#tzais_72 ⇒ Object
42
43
44
|
# File 'lib/zmanim/zmanim_calendar.rb', line 42
def tzais_72
tzais(offset: 72)
end
|
#use_elevation? ⇒ Boolean
18
19
20
|
# File 'lib/zmanim/zmanim_calendar.rb', line 18
def use_elevation?
!!@use_elevation
end
|