Class: When::CalendarNote::SovietFiveDayWeek

Inherits:
Week show all
Defined in:
lib/when_exe/region/russian.rb

Overview

五曜

Constant Summary collapse

Holidays =
{
  [1,22] => 5, [2,29] => 6, [5,1] => 5, [5,2] => 5, [11,7] => 5, [11,8] => 5
}
FirstDay =
[0, 0, 3, 4, 4, 3, 3, 4, 0, 0, 1, 4]
SkipDay =
{
  1 => [23,1], 5 => [3,2], 11 => [9,2]
}
Notes =

暦注要素の定義

[When::BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, alias]",
  "names:[SovietFiveDay]",

  # 日の暦注 ----------------------------
  [When::BasicTypes::M17n,
    "names:[day]",
    [When::BasicTypes::M17n,
      "names:[FiveDay, 五曜]",
      [DayOfWeek, "label:[I=      ]", {'delta'=>5}],
      [DayOfWeek, "label:[II=     ]", {'delta'=>5}],
      [DayOfWeek, "label:[III=    ]", {'delta'=>5}],
      [DayOfWeek, "label:[IV=     ]", {'delta'=>5}],
      [DayOfWeek, "label:[V=      ]", {'delta'=>5}],
      [DayOfWeek, "label:[Holiday=]", {'delta'=>190}],
      [DayOfWeek, "label:[Leapday=]", {'delta'=>1461}]
    ]
  ]
]]

Constants inherited from When::CalendarNote

Bahai, CalendarDepend, Chinese, CommonWithRokuyo, CommonWithSovietFiveDay, CommonWithSovietSixDay, Default, Javanese, JulianDay, Mayan, Tibetan, Yis

Constants included from Namespace

Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD

Instance Attribute Summary

Attributes inherited from When::CalendarNote

#event

Attributes inherited from TM::ReferenceSystem

#domain_of_validity, #position

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods inherited from Week

#common_week, #week_labels

Methods inherited from When::CalendarNote

#copy, #day, #duration, #enum_for, #include?, #month, #note?, #notes, #year

Methods inherited from TM::ReferenceSystem

#domain, #name

Methods included from Parts::Resource

#[], #^, _instance, _setup_, _setup_info, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_setup_

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Parts::Resource

Instance Method Details

#fiveday(date, base = nil) ⇒ Hash<:value=>When::CalendarNote::Week::DayOfWeek, :position=>Array<Integer>> Also known as: week

この日は何曜?

Parameters:

Returns:



79
80
81
82
83
84
# File 'lib/when_exe/region/russian.rb', line 79

def fiveday(date, base=nil)
  date  = _to_date_for_note(date)
  y,m,d = date.cal_date
  index = fiveday_index(m,d)
  {:value=>@days_of_week[index], :position=>[index, 7]}
end