Class: Zmanim::Limudim::LimudimFormatter
- Inherits:
-
Object
- Object
- Zmanim::Limudim::LimudimFormatter
- Includes:
- Util::HebrewNumericFormatter, Util::TextHelper
- Defined in:
- lib/zmanim/limudim/limudim_formatter.rb
Constant Summary collapse
- PARSHIYOS =
{ bereishis: 'בראשית', noach: 'נח', lech_lecha: 'לך לך', vayeira: 'וירא', chayei_sarah: 'חיי שרה', toldos: 'תולדות', vayeitzei: 'ויצא', vayishlach: 'וישלח', vayeishev: 'וישב', mikeitz: 'מקץ', vayigash: 'ויגש', vayechi: 'ויחי', shemos: 'שמות', vaeirah: 'וארא', bo: 'בא', beshalach: 'בשלח', yisro: 'יתרו', mishpatim: 'משפטים', terumah: 'תרומה', tetzaveh: 'תצוה', ki_sisa: 'כי תשא', vayakheil: 'ויקהל', pekudei: 'פקודי', vayikra: 'ויקרא', tzav: 'צו', shemini: 'שמיני', tazria: 'תזריע', metzora: 'מצורע', acharei: 'אחרי מות', kedoshim: 'קדושים', emor: 'אמר', behar: 'בהר', bechukosai: 'בחוקתי', bamidbar: 'במדבר', naso: 'נשא', behaalosecha: 'בהעלותך', shelach: 'שלח', korach: 'קרח', chukas: 'חקת', balak: 'בלק', pinchas: 'פינחס', matos: 'מטות', masei: 'מסעי', devarim: 'דברים', vaeschanan: 'ואתחנן', eikev: 'עקב', reei: 'ראה', shoftim: 'שופטים', ki_seitzei: 'כי תצא', ki_savo: 'כי תבא', nitzavim: 'נצבים', vayeilech: 'וילך', haazinu: 'האזינו', vezos_haberacha: 'וזאת הברכה', }
- MASECHTOS =
{ berachos: 'ברכות', peah: 'פאה', demai: 'דמאי', kilayim: 'כלאים', sheviis: 'שביעית', terumos: 'תרומות', maasros: 'מעשרות', maaser_sheni: 'מעשר שני', chalah: 'חלה', orlah: 'ערלה', bikurim: 'בכורים', shabbos: 'שבת', eruvin: 'ערובין', pesachim: 'פסחים', shekalim: 'שקלים', yoma: 'יומא', sukkah: 'סוכה', beitzah: 'ביצה', rosh_hashanah: 'ראש השנה', taanis: 'תענית', megillah: 'מגילה', moed_katan: 'מועד קטן', chagigah: 'חגיגה', yevamos: 'יבמות', kesubos: 'כתובות', nedarim: 'נדרים', nazir: 'נזיר', sotah: 'סוטה', gitin: 'גיטין', kiddushin: 'קידושין', bava_kamma: 'בבא קמא', bava_metzia: 'בבא מציעא', bava_basra: 'בבא בתרא', sanhedrin: 'סנהדרין', makkos: 'מכות', shevuos: 'שבועות', eduyos: 'עדיות', avodah_zarah: 'עבודה זרה', avos: 'אבות', horiyos: 'הוריות', zevachim: 'זבחים', menachos: 'מנחות', chullin: 'חולין', bechoros: 'בכורות', arachin: 'ערכין', temurah: 'תמורה', kerisos: 'כריתות', meilah: 'מעילה', tamid: 'תמיד', midos: 'מידות', kinnim: 'קינים', keilim: 'כלים', ohalos: 'אוהלות', negaim: 'נגעים', parah: 'פרה', taharos: 'טהרות', mikvaos: 'מקואות', niddah: 'נדה', machshirin: 'מכשירין', zavim: 'זבים', tevul_yom: 'טבול יום', yadayim: 'ידים', uktzin: 'עוקצין', no_daf_today: 'אין דף היום', }
Constants included from Util::HebrewNumericFormatter
Util::HebrewNumericFormatter::GERESH, Util::HebrewNumericFormatter::GERSHAYIM
Instance Attribute Summary collapse
-
#hebrew_format ⇒ Object
Returns the value of attribute hebrew_format.
Attributes included from Util::HebrewNumericFormatter
Instance Method Summary collapse
- #format_avos(limud) ⇒ Object
- #format_parsha(limud) ⇒ Object
- #format_talmudic(limud) ⇒ Object
- #format_tehillim(limud) ⇒ Object
-
#initialize ⇒ LimudimFormatter
constructor
A new instance of LimudimFormatter.
Methods included from Util::HebrewNumericFormatter
Methods included from Util::TextHelper
Constructor Details
#initialize ⇒ LimudimFormatter
Returns a new instance of LimudimFormatter.
135 136 137 138 |
# File 'lib/zmanim/limudim/limudim_formatter.rb', line 135 def initialize super @use_geresh_gershayim = false end |
Instance Attribute Details
#hebrew_format ⇒ Object
Returns the value of attribute hebrew_format.
10 11 12 |
# File 'lib/zmanim/limudim/limudim_formatter.rb', line 10 def hebrew_format @hebrew_format end |
Instance Method Details
#format_avos(limud) ⇒ Object
166 167 168 169 170 |
# File 'lib/zmanim/limudim/limudim_formatter.rb', line 166 def format_avos(limud) return '' unless unit = (limud && limud.unit) prefix = hebrew_format ? 'פרקי אבות ' : 'Pirkei Avos ' prefix + unit.render {|e| format_number(e) } end |
#format_parsha(limud) ⇒ Object
140 141 142 143 144 145 146 |
# File 'lib/zmanim/limudim/limudim_formatter.rb', line 140 def format_parsha(limud) return '' unless limud && limud.unit prefix = hebrew_format ? 'פרשת ' : 'Parshas ' prefix + limud.unit.render do |parsha| hebrew_format ? PARSHIYOS[parsha] : titleize(parsha) end end |
#format_talmudic(limud) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/zmanim/limudim/limudim_formatter.rb', line 148 def format_talmudic(limud) return '' unless unit = (limud && limud.unit) unit.render do |e| if e.is_a?(Numeric) format_number(e) elsif hebrew_format MASECHTOS[e] else titleize(e) end end end |
#format_tehillim(limud) ⇒ Object
161 162 163 164 |
# File 'lib/zmanim/limudim/limudim_formatter.rb', line 161 def format_tehillim(limud) prefix = hebrew_format ? 'תהלים ' : 'Tehillim ' prefix + limud.unit.render {|e| format_number(e) } end |