Class: When::CalendarNote::HinduNote::Dates
- Inherits:
-
Object
- Object
- When::CalendarNote::HinduNote::Dates
show all
- Defined in:
- lib/when_exe/region/indian.rb
Overview
pancanga 計算に必要となる情報をまとめた内部クラス
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(date) ⇒ Dates
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
|
# File 'lib/when_exe/region/indian.rb', line 1137
def initialize(date)
@o_date = date
clock = date.clock
frame = date.frame if date.frame.kind_of?(When::CalendarTypes::HinduLuniSolar)
@l_date = (frame || When.Calendar('HinduLuniSolar?note=HinduNote')).jul_trans(date.to_i, {:clock=>'+05:30'})
@root = When.CalendarNote('HinduNote/Notes')['day']
@formula = @l_date.frame.formula[-1]
@iri = @formula.iri
@rises = [@formula.sunrise(@l_date), @formula.sunrise(@l_date+When.Duration('P1D'))]
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
1149
1150
1151
1152
1153
1154
1155
1156
|
# File 'lib/when_exe/region/indian.rb', line 1149
def method_missing(name, *args, &block)
self.class.module_eval %Q{
def #{name}(*args, &block)
@l_date.send("#{name}", *args, &block)
end
} unless When::Parts::MethodCash.escape(name)
@l_date.send(name, *args, &block)
end
|
Instance Attribute Details
1133
1134
1135
|
# File 'lib/when_exe/region/indian.rb', line 1133
def formula
@formula
end
|
#iri ⇒ Object
1133
1134
1135
|
# File 'lib/when_exe/region/indian.rb', line 1133
def iri
@iri
end
|
#l_date ⇒ Object
1133
1134
1135
|
# File 'lib/when_exe/region/indian.rb', line 1133
def l_date
@l_date
end
|
#o_date ⇒ Object
1133
1134
1135
|
# File 'lib/when_exe/region/indian.rb', line 1133
def o_date
@o_date
end
|
#rises ⇒ Object
1133
1134
1135
|
# File 'lib/when_exe/region/indian.rb', line 1133
def rises
@rises
end
|
#root ⇒ Object
1133
1134
1135
|
# File 'lib/when_exe/region/indian.rb', line 1133
def root
@root
end
|