Class: When::CalendarNote::Japanese::Cal4Note
- Inherits:
-
Object
- Object
- When::CalendarNote::Japanese::Cal4Note
- Defined in:
- lib/when_exe/region/japanese/notes.rb,
lib/when_exe/region/japanese/notes.rb
Overview
日本暦注が使用する暦法
Instance Attribute Summary collapse
-
#calendar ⇒ Object
readonly
Returns the value of attribute calendar.
-
#solar ⇒ Object
readonly
Returns the value of attribute solar.
Instance Method Summary collapse
- #doyo ⇒ Object
-
#initialize(calendar, solar) ⇒ Cal4Note
constructor
A new instance of Cal4Note.
- #l_calendar ⇒ Object
- #l_phases ⇒ Object
- #s_calendar ⇒ Object
- #s_terms ⇒ Object
- #s_terms2 ⇒ Object
Constructor Details
#initialize(calendar, solar) ⇒ Cal4Note
Returns a new instance of Cal4Note.
25 26 27 28 |
# File 'lib/when_exe/region/japanese/notes.rb', line 25 def initialize(calendar, solar) @calendar = calendar @solar = solar end |
Instance Attribute Details
#calendar ⇒ Object (readonly)
Returns the value of attribute calendar.
375 376 377 |
# File 'lib/when_exe/region/japanese/notes.rb', line 375 def calendar @calendar end |
#solar ⇒ Object (readonly)
Returns the value of attribute solar.
375 376 377 |
# File 'lib/when_exe/region/japanese/notes.rb', line 375 def solar @solar end |
Instance Method Details
#doyo ⇒ Object
398 399 400 |
# File 'lib/when_exe/region/japanese/notes.rb', line 398 def doyo @doyo ||= (s_calendar.doyo ? s_calendar.doyo * 360.0 / s_calendar.formula[0].year_length : 0) end |
#l_calendar ⇒ Object
377 378 379 |
# File 'lib/when_exe/region/japanese/notes.rb', line 377 def l_calendar @l_calendar ||= When.Calendar(@calendar.kind_of?(String) ? @calendar.sub(/#\{\?.+?\}/, '') : @calendar) end |
#l_phases ⇒ Object
385 386 387 |
# File 'lib/when_exe/region/japanese/notes.rb', line 385 def l_phases @l_phases ||= Japanese::LunarPhases.new('formula'=>l_calendar.formula[-1]) end |
#s_calendar ⇒ Object
381 382 383 |
# File 'lib/when_exe/region/japanese/notes.rb', line 381 def s_calendar @s_calendar ||= When.Calendar(@solar.kind_of?(String) ? @solar.sub(/#\{\?.+?\}/, '?Clock=THS') : @solar) end |
#s_terms ⇒ Object
389 390 391 |
# File 'lib/when_exe/region/japanese/notes.rb', line 389 def s_terms @s_terms ||= Japanese::SolarTerms.new('formula'=>s_calendar.formula[0]) end |
#s_terms2 ⇒ Object
393 394 395 396 |
# File 'lib/when_exe/region/japanese/notes.rb', line 393 def s_terms2 @s_terms2 ||= @l_calendar.iri =~ /JapaneseTwin(.*?)::天保暦/ ? Japanese::SolarTermsRevised.new('formula'=>s_calendar.formula[0]) : s_terms end |