Class: When::CalendarNote::RokuyoWeek

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

Overview

六曜

Constant Summary collapse

Notes =

暦注要素の定義

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

  # 日の暦注 ----------------------------
  [When::BasicTypes::M17n,
    "names:[day]",
    [When::BasicTypes::M17n,
      "names:[Rokuyo=, 六曜, 六曜=zh:%%<六曜>]",
      [DayOfWeek, "label:[Taian=,      *大安=ja:%%<六曜>#%.<大安>, 大安=ja:%%<六曜>#%.<大安>]", {'delta'=>6}],
      [DayOfWeek, "label:[Shakko=,     *赤口=ja:%%<六曜>#%.<赤口>, 赤口=ja:%%<六曜>#%.<赤口>]", {'delta'=>6}],
      [DayOfWeek, "label:[Sensho=,     *先勝=ja:%%<六曜>#%.<先勝>, 先勝=ja:%%<六曜>#%.<先勝>]", {'delta'=>6}],
      [DayOfWeek, "label:[Tomobiki=,   *友引=ja:%%<六曜>#%.<友引>, 友引=ja:%%<六曜>#%.<友引>]", {'delta'=>6}],
      [DayOfWeek, "label:[Sembu=,      *先負=ja:%%<六曜>#%.<先負>, 先負=ja:%%<六曜>#%.<先負>]", {'delta'=>6}],
      [DayOfWeek, "label:[Butsumetsu=, *仏滅=ja:%%<六曜>#%.<仏滅>, 仏滅=zh:%%<佛滅日>]", {'delta'=>6}]
    ]
  ]
]]

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

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

この日は何曜?

Parameters:

Returns:



50
51
52
53
54
55
# File 'lib/when_exe/region/japanese/weeks.rb', line 50

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