Class Index [+]

Quicksearch

When::CalendarTypes::Tibetan

Tibetan Calendar

Private Instance Methods

_ids_(date) click to toggle source

日時要素の翻訳表の取得

  引数パターン1
    date    : [y]
      y - 年

    returns : [When::Coordinates::Pair]
      1年の月の配置の翻訳表

  引数パターン2
    date    : [y, m]
      y - 年
      m - 月(0 始まりの通番)

    returns : [When::Coordinates::Pair]
      1月の日の配置の翻訳表
     # File when/region/tibetan.rb, line 178
178:       def _ids_(date)
179:         y, m = date
180:         y    = +y
181:         mm   = _new_year_month(y)
182:         return (_table(mm, 12, 0, 1) {|i| _new_year_month(y,i)}) unless m
183:         mm  += m
184:         return (_table(_new_month_(mm), 30, 1, 1) {|i| _new_month(mm,i)})
185:       end
_new_month_(m, d=0) click to toggle source

積日計算

  m       : 積月
  d       : 日(デフォルト 0)

  returns : 積日

  d に 0 以外を指定することで、積日の跳び(重日)、ダブり(欠日)を検出できる
     # File when/region/tibetan.rb, line 151
151:       def _new_month_(m, d=0)
152:         d   += 1
153:         w    = m * @parameter['Wo'] + @parameter['W0'] + d * @parameter['Wd']  # 中曜
154:         s    = m * @parameter['So'] + @parameter['S0'] + d * @parameter['Sd']  # 中日
155:         sdn  = D0 + w
156:         sdn += _sn(m*Am+@parameter['A0']+d, 14, Jm)
157:         sdn -= _sn((s-V0)*(60.0/135.0), 6, Js)
158:         return sdn.floor
159:       end
_new_year_month_(y, m=0) click to toggle source

積月計算

  y       : 年
  m       : 月(デフォルト 0)

  returns : 積月

  m に 0 以外を指定することで、積月の跳び(閏)を検出できる
     # File when/region/tibetan.rb, line 135
135:       def _new_year_month_(y, m=0)
136:         mm = (y-Y0) * 12 + (m - 2)
137:         mm += (mm * 2 + @parameter['M0']).divmod(65)[Quot]
138:         return mm
139:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.