Class: When::CalendarTypes::CalendarNote::Christian
- Inherits:
-
When::CalendarTypes::CalendarNote
- Object
- BasicTypes::Object
- TM::Object
- TM::ReferenceSystem
- When::CalendarTypes::CalendarNote
- When::CalendarTypes::CalendarNote::Christian
- Defined in:
- lib/when_exe/region/christian.rb
Overview
キリスト教の暦注(クリスマスと復活祭)
Constant Summary collapse
- NoteObjects =
[When::BasicTypes::M17n, [ "namespace:[en=http://en.wikipedia.org/wiki/, ja=http://ja.wikipedia.org/wiki/]", "locale:[=en:, ja=ja:, alias]", "names:[Christian]", # 年の暦注 ---------------------------- [When::BasicTypes::M17n, "names:[year]" ], # 月の暦注 ---------------------------- [When::BasicTypes::M17n, "names:[month]", [When::BasicTypes::M17n, "names:[Month]" ] ], # 日の暦注 ---------------------------- [When::BasicTypes::M17n, "names:[day]", [When::BasicTypes::M17n, "names:[Easter, 復活祭]" ], [When::BasicTypes::M17n, "names:[Christmas, クリスマス]"] ] ]]
Constants inherited from When::CalendarTypes::CalendarNote
BahaiNotes, ChineseNotes, DefaultNotes, JavaneseNotes, JulianDayNotes, MayanNotes, YiNotes
Constants included from Parts::Resource
Parts::Resource::LabelProperty, Parts::Resource::Prefix, Parts::Resource::PrefixIndex, Parts::Resource::PrefixKeys, Parts::Resource::PrefixValues
Instance Attribute Summary collapse
-
#b ⇒ Integer
readonly
ベース.
-
#c ⇒ Integer
readonly
月の位相の補正.
-
#d ⇒ Integer
readonly
最も遅い満月の3月0日からの日数.
-
#f ⇒ Integer
readonly
満月補正フラグ.
-
#g ⇒ Integer
readonly
ガード.
-
#n ⇒ Integer
readonly
平年数.
-
#s ⇒ Integer
readonly
置閏周期.
-
#w ⇒ Integer
readonly
週日補正フラグ.
-
#x ⇒ Integer
readonly
クリスマスの3月0日からの日数.
Attributes inherited from When::CalendarTypes::CalendarNote
Attributes inherited from TM::ReferenceSystem
#domain, #domain_of_validity, #position
Attributes inherited from BasicTypes::Object
Attributes included from Parts::Resource
#_pool, #child, #keys, #locale, #namespace
Instance Method Summary collapse
-
#_delta(parameter = nil) ⇒ Object
(also: #christmas_delta, #easter_delta)
イベントの標準的な間隔を返す.
-
#christmas(date, frame = nil) ⇒ Integer, When::TM::CalDate
クリスマス.
-
#easter(date, frame = nil) ⇒ Integer, When::TM::CalDate
復活祭.
Methods inherited from When::CalendarTypes::CalendarNote
#copy, #day, #duration, #enum_for, #include?, #month, #note?, #notes, #year
Methods inherited from TM::ReferenceSystem
Methods inherited from BasicTypes::Object
Methods included from Parts::Resource
#[], #^, _extract_prefix, _instance, _parse, _path_with_prefix, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #next, #parent, #prev, #registered?
Methods included from Parts::Resource::Pool
#[], #[]=, #_pool, #_setup_, #pool_keys
Methods included from Parts::Resource::Synchronize
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class When::Parts::Resource
Instance Attribute Details
#b ⇒ Integer (readonly)
ベース
517 518 519 |
# File 'lib/when_exe/region/christian.rb', line 517 def b @b end |
#c ⇒ Integer (readonly)
月の位相の補正
509 510 511 |
# File 'lib/when_exe/region/christian.rb', line 509 def c @c end |
#d ⇒ Integer (readonly)
最も遅い満月の3月0日からの日数
493 494 495 |
# File 'lib/when_exe/region/christian.rb', line 493 def d @d end |
#f ⇒ Integer (readonly)
満月補正フラグ
521 522 523 |
# File 'lib/when_exe/region/christian.rb', line 521 def f @f end |
#g ⇒ Integer (readonly)
ガード
513 514 515 |
# File 'lib/when_exe/region/christian.rb', line 513 def g @g end |
#n ⇒ Integer (readonly)
平年数
501 502 503 |
# File 'lib/when_exe/region/christian.rb', line 501 def n @n end |
#s ⇒ Integer (readonly)
置閏周期
505 506 507 |
# File 'lib/when_exe/region/christian.rb', line 505 def s @s end |
#w ⇒ Integer (readonly)
週日補正フラグ
489 490 491 |
# File 'lib/when_exe/region/christian.rb', line 489 def w @w end |
#x ⇒ Integer (readonly)
クリスマスの3月0日からの日数
497 498 499 |
# File 'lib/when_exe/region/christian.rb', line 497 def x @x end |
Instance Method Details
#_delta(parameter = nil) ⇒ Object Also known as: christmas_delta, easter_delta
イベントの標準的な間隔を返す
565 566 567 |
# File 'lib/when_exe/region/christian.rb', line 565 def _delta(parameter=nil) return When::DurationP1Y end |
#christmas(date, frame = nil) ⇒ Integer, When::TM::CalDate
クリスマス
532 533 534 535 536 |
# File 'lib/when_exe/region/christian.rb', line 532 def christmas(date, frame=nil) _event(date, 'christmas', frame) do |year, frame| @x - 1 + frame._coordinates_to_number(year, 2, 0) end end |
#easter(date, frame = nil) ⇒ Integer, When::TM::CalDate
復活祭
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/when_exe/region/christian.rb', line 547 def easter(date, frame=nil) _event(date, 'easter', frame) do |year, frame| golden = (year+@b) % @s + 1 m = (frame._lunar_equation(year) + 11*golden + @c) % 30 if @f == 0 m += 1 if m==0 || m==1 && golden>=@n else m += (golden-1) / @f m -= 30 if m>=@n end result = frame._coordinates_to_number(year, 2, 0) + @d - 1 - m result += @g - (result-@w) % 7 if @w<7 result end end |