Class: When::Coordinates::Wuku

Inherits:
Residue show all
Defined in:
lib/when_exe/region/balinese.rb

Overview

ウク周期

Constant Summary collapse

Urip7 =

Urip 7

[ 5, 4, 3, 7, 8, 6, 9]
Urip5 =

Urip 5

[ 9, 7, 4, 8, 5]
Dwiwara =

2日週

(0...35).to_a.map {|d| (Urip7[d % 7] + Urip5[d % 5]) %  2}
Dasawara =

10日週

(0...35).to_a.map {|d| (Urip7[d % 7] + Urip5[d % 5]) % 10}
Watek =

Watek

(0...35).to_a.map {|d|  Urip7[d % 7] + Urip5[d % 5] - 7  }

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

#astawaraWhen::BasicTypes::M17n

8日週


105
106
107
108
# File 'lib/when_exe/region/balinese.rb', line 105

def astawara
  index = (@remainder + 137) % 210
  When.CalendarNote('BalineseNote/NoteObjects')['day']['Astawara'][index >= 208 ? 6 : (index-1) % 8]
end

#dasawaraWhen::BasicTypes::M17n

10日週


119
120
121
# File 'lib/when_exe/region/balinese.rb', line 119

def dasawara
  When.CalendarNote('BalineseNote/NoteObjects')['day']['Dasawara'][Dasawara[@remainder % 35]]
end

#dwiwaraWhen::BasicTypes::M17n

2日週


92
93
94
# File 'lib/when_exe/region/balinese.rb', line 92

def dwiwara
  When.CalendarNote('BalineseNote/NoteObjects')['day']['Dwiwara'][Dwiwara[@remainder % 35]]
end

#sangawaraWhen::BasicTypes::M17n

9日週


112
113
114
115
# File 'lib/when_exe/region/balinese.rb', line 112

def sangawara
  index = @remainder - 3
  When.CalendarNote('BalineseNote/NoteObjects')['day']['Sangawara'][index < 0 ? 0 : index % 9]
end

#tjaturwaraWhen::BasicTypes::M17n

4日週


98
99
100
101
# File 'lib/when_exe/region/balinese.rb', line 98

def tjaturwara
  index = (@remainder + 137) % 210
  When.CalendarNote('BalineseNote/NoteObjects')['day']['Tjaturwara'][index >= 208 ? 2 : (index-1) % 4]
end

#watekWhen::BasicTypes::M17n

Watek


125
126
127
# File 'lib/when_exe/region/balinese.rb', line 125

def watek
  When.CalendarNote('BalineseNote/NoteObjects')['day']['Watek'][Watek[@remainder % 35]]
end