Class Index [+]

Quicksearch

When::CalendarTypes::EphemerisBasedLuniSolar

月日の配当が太陽および月の位置によって決定される暦

  Calendar based on the ephemeris of the Sun or the Moon

Public Instance Methods

_coordinates_to_number(yy, mm=0, dd=0) click to toggle source

年月日 -> 通日

  y       - 年
  m       - 月 (0 始まり)
  d       - 日 (0 始まり)

  returns : 通日
     # File when/calendartypes.rb, line 672
672:     def _coordinates_to_number(yy, mm=0, dd=0)
673:       _new_month(_new_year_month(+yy) + mm) + dd
674:     end
_number_to_coordinates(sdn) click to toggle source

通日 - > 年月日

  sdn     : 通日

  returns : [y, m, d]
    y     - 年
    m     - 月 (0 始まり)
    d     - 日 (0 始まり)
     # File when/calendartypes.rb, line 685
685:     def _number_to_coordinates(sdn)
686:       nn, dd = Residue.mod(sdn) {|m| _new_month(m)}
687:       yy, mm = Residue.mod(nn)  {|y| _new_year_month(y)}
688:       [yy, mm, dd]
689:     end

Private Instance Methods

_length(date) click to toggle source

暦要素数

  引数パターン1
    date    : [y]
      y     - 年
    returns : その年の月数

  引数パターン2
    date    : [y, m]
      y     - 年
      m     - 月 (0 始まり)
    returns : その年月の日数
     # File when/calendartypes.rb, line 706
706:     def _length(date)
707:       y, m = date
708:       if (m)
709:         #  指定した月に含まれる日の数を返します。
710:         m += _new_year_month(+y)
711:         return _new_month(m+1) - _new_month(m)
712:       else
713:         #  指定した年に含まれる月の数を返します。
714:         return _ids([y]).length
715:       end
716:     end
_new_month_(m) click to toggle source

月初の通日

  m       : 通月

  returns : 月初の通日
     # File when/calendartypes.rb, line 735
735:     def _new_month_(m)
736:       (@formula[1].cn_to_time(m) + 0.5 + @timezone[0] + @timezone[1]).floor
737:     end
_new_year_month_(y) click to toggle source

年初の通月

  y       : 年

  returns : 年初の通月
     # File when/calendartypes.rb, line 745
745:     def _new_year_month_(y)
746:       raise TypeError, 'EphemerisBasedLuniSolar is abstract class'
747:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.