Class: When::CalendarTypes::MultiBorder
- Inherits:
-
Border
- Object
- BasicTypes::Object
- TM::Object
- TM::ReferenceSystem
- Border
- When::CalendarTypes::MultiBorder
- Defined in:
- lib/when_exe/calendartypes.rb
Overview
日時要素の境界 - 年/日によって、異なる境界を使用する場合
Constant Summary
Constants included from Parts::Resource
Parts::Resource::LabelProperty, Parts::Resource::Prefix, Parts::Resource::PrefixIndex, Parts::Resource::PrefixKeys, Parts::Resource::PrefixValues
Instance Attribute Summary collapse
-
#borders ⇒ Array<When::CalendarTypes::Border>
readonly
境界の配列.
Attributes inherited from TM::ReferenceSystem
#domain, #domain_of_validity, #position
Attributes inherited from BasicTypes::Object
Attributes included from Parts::Resource
#_pool, #child, #keys, #locale, #namespace
Instance Method Summary collapse
-
#_adjust_epoch(date, frame = nil) ⇒ Array<Numeric>
境界の正規化.
-
#behavior ⇒ Numeric
境界の振舞.
-
#border(date = [], frame = nil) ⇒ Array<Numeric>
境界の取得.
Methods inherited from TM::ReferenceSystem
Methods inherited from BasicTypes::Object
Methods included from Parts::Resource
#[], #^, _extract_prefix, _instance, _parse, _path_with_prefix, #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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class When::Parts::Resource
Instance Attribute Details
#borders ⇒ Array<When::CalendarTypes::Border> (readonly)
境界の配列
971 972 973 |
# File 'lib/when_exe/calendartypes.rb', line 971 def borders @borders end |
Instance Method Details
#_adjust_epoch(date, frame = nil) ⇒ Array<Numeric>
境界の正規化
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 |
# File 'lib/when_exe/calendartypes.rb', line 1009 def _adjust_epoch(date, frame=nil) @borders.each do |border| next unless date[0] >= border[:key] s_date = date.dup e_date = border[:border].border(date[0..0], frame) branch = border[:border].behavior * 0 branch += 1 if ((s_date[1..-1] <=> e_date[1..-1]) < 0) s_date[0] = When::Coordinates::Pair.new(+s_date[0]-branch, branch) return s_date end date end |
#behavior ⇒ Numeric
境界の振舞
982 983 984 |
# File 'lib/when_exe/calendartypes.rb', line 982 def behavior @borders[0][:border].behavior end |
#border(date = [], frame = nil) ⇒ Array<Numeric>
境界の取得
993 994 995 996 997 998 999 1000 |
# File 'lib/when_exe/calendartypes.rb', line 993 def border(date=[], frame=nil) last = date.length-1 return @borders[0][:boder] if (last<0) @borders.each do |border| return border[:border].border(date, frame) if date[0] >= border[:key] end date[0..last] end |