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

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

Constants inherited from Residue

Residue::LabelProperty

Constants included from Parts::Resource

Parts::Resource::LabelProperty

Instance Attribute Summary

Attributes inherited from Residue

#carry, #divisor, #remainder, #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, #_enumerator, #_to_hash_value, day_of_week, #difference, #duration, #event, #initialize, mod, #to, #to_m17n, #to_s

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

#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

日の十干で決まる暦注



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/when_exe/region/japanese_residues.rb', line 96

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

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



89
90
91
# File 'lib/when_exe/region/japanese_residues.rb', line 89

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

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

年の十干で決まる暦注



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

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