Class: When::CalendarTypes::Civil
- Inherits:
-
Gregorian
- Object
- BasicTypes::Object
- TM::Object
- TM::ReferenceSystem
- TM::Calendar
- Julian
- Gregorian
- When::CalendarTypes::Civil
- Defined in:
- lib/when_exe/region/christian.rb
Overview
Civil Calendar
Constant Summary
Constants included from When::Coordinates
When::Coordinates::Bahai, When::Coordinates::CommonResidue, When::Coordinates::DefaultDateIndices, When::Coordinates::DefaultDayIndex, When::Coordinates::DefaultTimeIndices, When::Coordinates::IndianCities, When::Coordinates::Javanese, When::Coordinates::MATCH, When::Coordinates::Mayan, When::Coordinates::PERIOD, When::Coordinates::PERIOD_NAME, When::Coordinates::PRECISION, When::Coordinates::PRECISION_NAME, When::Coordinates::Tibetan, When::Coordinates::VALUE, When::Coordinates::Yi
Constants included from Parts::Resource
Parts::Resource::LabelProperty
Instance Attribute Summary collapse
-
#reform_jdn ⇒ Integer
readonly
グレゴリオ暦への改暦日付.
Attributes inherited from TM::Calendar
Attributes inherited from TM::ReferenceSystem
#domain_of_validity, #position
Attributes inherited from BasicTypes::Object
Attributes included from Parts::Resource
#_pool, #child, #keys, #locale, #namespace
Instance Method Summary collapse
-
#_coordinates_to_number(y, m, d) ⇒ Integer
年月日 -> 通日.
-
#_length(date) ⇒ Object
暦要素数.
-
#_lunar_equation(year) ⇒ Integer
太陰方程式.
-
#_number_to_coordinates(jdn) ⇒ Array<Integer>
通日 - > 年月日.
-
#first_year_of_border ⇒ Integer
年初の最初の定義の年.
Methods inherited from Gregorian
Methods inherited from TM::Calendar
#_new_month_, _setup_, #_to_month_number_, #date_trans, #jul_trans, #rate_of_clock, #time_standard, #to_cal_date, #to_julian_date, #to_universal_time
Methods included from TimeStandard::TimeBasis
Methods included from When::Coordinates
Methods inherited from TM::ReferenceSystem
Methods included from Parts::Resource
#[], #^, _decode, _encode, _extract_prefix, _instance, _parse, _path_with_prefix, _replace_tags, _setup_, #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
#reform_jdn ⇒ Integer (readonly)
グレゴリオ暦への改暦日付
283 284 285 |
# File 'lib/when_exe/region/christian.rb', line 283 def reform_jdn @reform_jdn end |
Instance Method Details
#_coordinates_to_number(y, m, d) ⇒ Integer
年月日 -> 通日
305 306 307 308 309 310 |
# File 'lib/when_exe/region/christian.rb', line 305 def _coordinates_to_number(y,m,d) skip, limit = @the_length[[y,m]] d += skip if skip && d >= limit jdn = super(y,m,d) jdn >= @reform_jdn ? jdn : @past._coordinates_to_number(y + @origin_of_MSC - @past.origin_of_MSC, m, d) end |
#_length(date) ⇒ Integer #_length(date) ⇒ Integer
暦要素数
344 345 346 347 348 349 350 351 |
# File 'lib/when_exe/region/christian.rb', line 344 def _length(date) return @the_length[date][2] if @the_length[date] yy, mm = date (yy > @reform_date[0]) || (yy == @reform_date[0] && (!mm || mm >= @reform_date[1])) ? super : @past._length([yy + @origin_of_MSC - @past.origin_of_MSC, mm]) end |
#_lunar_equation(year) ⇒ Integer
太陽暦日の補正も、本メソッドで行う
太陰方程式
359 360 361 |
# File 'lib/when_exe/region/christian.rb', line 359 def _lunar_equation(year) year >= @the_easter ? super : 0 end |
#_number_to_coordinates(jdn) ⇒ Array<Integer>
通日 - > 年月日
321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/when_exe/region/christian.rb', line 321 def _number_to_coordinates(jdn) if jdn >= @reform_jdn date = super else date = @past._number_to_coordinates(jdn) date[0] -= @origin_of_MSC - @past.origin_of_MSC end skip, limit = @the_length[date[0..-2]] date[2] -= skip if skip && date[2] >= limit date end |
#first_year_of_border ⇒ Integer
年初の最初の定義の年
291 292 293 294 295 |
# File 'lib/when_exe/region/christian.rb', line 291 def first_year_of_border return nil unless @border.kind_of?(When::CalendarTypes::MultiBorder) year = @border.borders[-1][:key] year.kind_of?(Integer) ? year : nil end |