Changeset 157 for ruby/trunk/lib/models/rm/data_types/quantity/date_time.rb
- Timestamp:
- Jul 5, 2009, 11:01:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/models/rm/data_types/quantity/date_time.rb
r151 r157 11 11 module Date_Time 12 12 class DV_Temporal < OpenEHR::RM::Data_Types::Quantity::DV_Absolute_Quantity 13 include Comparable 13 14 attr_reader :value 14 15 … … 29 30 end 30 31 @value = value 32 end 33 34 def <=>(other) 35 self.magnitude <=> other.magnitude 31 36 end 32 37 end … … 151 156 152 157 def magnitude 153 return DateTime.new(@year,@month,@day,@hour,@minute,@second) - 154 DateTime.new(0000,1,1,0,0,0) + @fractional_second 158 seconds = DateTime.new(@year,@month,@day,@hour,@minute,@second) - 159 DateTime.new(0000,1,1,0,0,0) 160 if @fractional_second.nil? 161 return seconds 162 else 163 return seconds + @fractional_second 164 end 155 165 end 156 166
Note:
See TracChangeset
for help on using the changeset viewer.