暦座標値
閏秒のある暦座標の値を表現する
加算
other : Numeric returns : When::Coordinates::LeapSeconds other が When::Coordinates::LeapSeconds でない場合、trunk に対する加算となる
# File when/coordinates.rb, line 899 899: def +(other) 900: return self.class.new(@trunk + +other, @branch, @second) unless other.kind_of?(self.class) 901: return self.class.new(@trunk + other.trunk, @branch + other.branch, @second) 902: end
減算
other : Numeric returns : When::Coordinates::LeapSeconds other が When::Coordinates::LeapSeconds でない場合、trunk に対する減算となる
# File when/coordinates.rb, line 911 911: def -(other) 912: return self.class.new(@trunk - +other, @branch, @second) unless other.kind_of?(self.class) 913: return self.class.new(@trunk - other.trunk, @branch - other.branch, @second) 914: end
比較
other : Numeric returns : Integer(負,0,正) trunk の整数部, branch, trunk の小数部の順に比較する
# File when/coordinates.rb, line 935 935: def <=>(other) 936: other = self.class.new(+other, 0, @second) unless other.kind_of?(self.class) 937: raise ArgumentError, "length of unit 'second' mismatch" unless @second == other.second 938: (@int <=> other.int).nonzero? || (@branch <=> other.branch).nonzero? || (@frac <=> other.frac) 939: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.