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.
363 364 365 |
# File 'lib/when_exe/region/japanese/notes.rb', line 363 def calendar @calendar end |
#solar ⇒ Object (readonly)
Returns the value of attribute solar.
363 364 365 |
# File 'lib/when_exe/region/japanese/notes.rb', line 363 def solar @solar end |
Instance Method Details
#doyo ⇒ Object
386 387 388 |
# File 'lib/when_exe/region/japanese/notes.rb', line 386 def doyo @doyo ||= (s_calendar.doyo ? s_calendar.doyo * 360.0 / s_calendar.formula[0].year_length : 0) end |
#l_calendar ⇒ Object
365 366 367 |
# File 'lib/when_exe/region/japanese/notes.rb', line 365 def l_calendar @l_calendar ||= When.Calendar(@calendar.kind_of?(String) ? @calendar.sub(/#\{\?.+?\}/, '') : @calendar) end |
#l_phases ⇒ Object
373 374 375 |
# File 'lib/when_exe/region/japanese/notes.rb', line 373 def l_phases @l_phases ||= Japanese::LunarPhases.new('formula'=>l_calendar.formula[-1]) end |
#s_calendar ⇒ Object
369 370 371 |
# File 'lib/when_exe/region/japanese/notes.rb', line 369 def s_calendar @s_calendar ||= When.Calendar(@solar.kind_of?(String) ? @solar.sub(/#\{\?.+?\}/, '?Clock=THS') : @solar) end |
#s_terms ⇒ Object
377 378 379 |
# File 'lib/when_exe/region/japanese/notes.rb', line 377 def s_terms @s_terms ||= Japanese::SolarTerms.new('formula'=>s_calendar.formula[0]) end |
#s_terms2 ⇒ Object
381 382 383 384 |
# File 'lib/when_exe/region/japanese/notes.rb', line 381 def s_terms2 @s_terms2 ||= @l_calendar.iri =~ /JapaneseTwin(.*?)::天保暦/ ? Japanese::SolarTermsRevised.new('formula'=>s_calendar.formula[0]) : s_terms end |