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::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

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, #_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, #next, #parent, #prev, #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

#astawaraWhen::BasicTypes::M17n

8日週



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

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

#dasawaraWhen::BasicTypes::M17n

10日週



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

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

#dwiwaraWhen::BasicTypes::M17n

2日週



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

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

#sangawaraWhen::BasicTypes::M17n

9日週



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

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

#tjaturwaraWhen::BasicTypes::M17n

4日週



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

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

#watekWhen::BasicTypes::M17n

Watek



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

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