Class: When::Coordinates::Stem

Inherits:
Residue show all
Defined in:
lib/when_exe/region/residue.rb,
lib/when_exe/region/japanese/residues.rb

Overview

十干

Constant Summary collapse

Rules =
{
  '歳徳' => %w(東宮甲 西宮庚 南宮丙 北宮壬 南宮丙 東宮甲 西宮庚 南宮丙 北宮壬 南宮丙),
  '金神' => %w(午未申酉 辰巳 子丑寅卯午未 寅卯戌亥 子丑申酉)
}

Constants inherited from Residue

Residue::HashProperty, Residue::LabelProperty

Constants included from Parts::Resource

Parts::Resource::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIDecode, Parts::Resource::IRIDecodeTable, Parts::Resource::IRIEncode, Parts::Resource::IRIEncodeTable, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty

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 Residue

#carry, #divisor, #remainder, #shifted, #units

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#_pool, #child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods inherited from Residue

#%, #&, #+, #-, #<<, #>>, #[], _china, #_column_for_week_included, _day_of_week, #_enumerator, #_range_for_week_included, day_of_week, #difference, #duration, #event, #initialize, mod, #to, #to_m17n, #to_s

Methods included from Parts::Resource

#[], #^, _abbreviation_to_iri, _decode, _encode, _extract_prefix, _instance, _instantiate, _parse, _path_with_prefix, _replace_tags, _setup_, _setup_info, _simplify_path, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_pool, #_setup_, #pool_keys

Methods included from Parts::Resource::Synchronize

#synchronize

Constructor Details

This class inherits a constructor from When::Coordinates::Residue

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Coordinates::Residue

Instance Method Details

#_day_notes(notes = {}, dates = nil, conditions = {}) ⇒ Object

日の十干で決まる暦注



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/when_exe/region/japanese/residues.rb', line 148

def _day_notes(notes={}, dates=nil, conditions={})

  year, month = dates.s_date.cal_date

  # 節月に依存する暦注
  notes['' ]      ||= [[4,5],[0,6],[1,7],[4,5],[2,8],[3,9]][month % 6].include?(@remainder) ? '' : nil

  # 不断の暦注
  notes['不視病']   ||= @remainder == 4 ? '不視病' : nil
  notes['不問疾']   ||= @remainder == 5 ? '不問疾' : nil

  # 凶会日に省略される吉日
  return notes if notes['凶会']

  # 節年に依存する暦注
  notes['歳徳'  ]   ||= @remainder == [6,2,8,4,0][year % 5] ? '歳徳'   : nil
  notes['歳徳'  ]   ||= @remainder == [1,7,3,9,5][year % 5] ? '歳徳合' : nil

  # 節月に依存する暦注
  notes['月徳'  ]   ||= @remainder == [6,2,0,8][month % 4]  ? '月徳'   : nil
  notes['月徳'  ]   ||= @remainder == [1,7,5,3][month % 4]  ? '月徳合' : nil
  notes
end

#_month_notes(notes = {}, dates = nil, conditions = {}) ⇒ Object

月の十干で決まる暦注(ダミー)



141
142
143
# File 'lib/when_exe/region/japanese/residues.rb', line 141

def _month_notes(notes={}, dates=nil, conditions={})
  notes
end

#_year_notes(notes = {}, dates = nil, conditions = {}) ⇒ Object

年の十干で決まる暦注



132
133
134
135
136
# File 'lib/when_exe/region/japanese/residues.rb', line 132

def _year_notes(notes={}, dates=nil, conditions={})
  notes['歳徳']     ||= Rules['歳徳'][@remainder]
  notes['金神']     ||= Rules['金神'][@remainder % 5]
  notes
end