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
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
|
# File 'lib/when_exe/region/indian.rb', line 1068
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
1080
1081
1082
1083
1084
1085
1086
1087
|
# File 'lib/when_exe/region/indian.rb', line 1080
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
1064
1065
1066
|
# File 'lib/when_exe/region/indian.rb', line 1064
def formula
@formula
end
|
#iri ⇒ Object
1064
1065
1066
|
# File 'lib/when_exe/region/indian.rb', line 1064
def iri
@iri
end
|
#l_date ⇒ Object
1064
1065
1066
|
# File 'lib/when_exe/region/indian.rb', line 1064
def l_date
@l_date
end
|
#o_date ⇒ Object
1064
1065
1066
|
# File 'lib/when_exe/region/indian.rb', line 1064
def o_date
@o_date
end
|
#rises ⇒ Object
1064
1065
1066
|
# File 'lib/when_exe/region/indian.rb', line 1064
def rises
@rises
end
|
#root ⇒ Object
1064
1065
1066
|
# File 'lib/when_exe/region/indian.rb', line 1064
def root
@root
end
|