Changeset 342 for ruby


Ignore:
Timestamp:
Nov 12, 2009, 12:01:35 AM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

ref #55, fixed #54

Location:
ruby/branches/0.5
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity/date_time.rb

    r335 r342  
    8181              end
    8282              year += future.year - past.year
    83               return DvDuration.new(
     83              return DvDuration.new(:value =>
    8484                   'P' + year.to_s + 'Y' + month.to_s + 'M' +
    8585                         week.to_s + 'W' + day.to_s + 'D')
     
    109109              second = (diff - hour * 60 *60 - minute * 60).to_i
    110110              fractional_second = ((diff - diff.to_i)*1000000.0).to_i/1000000.0
    111               return DvDuration.new('P0Y0M0W0DT' + hour.to_s + 'H' +
     111              return DvDuration.new(:value =>
     112                        'P0Y0M0W0DT' + hour.to_s + 'H' +
    112113                        minute.to_s + 'M' +
    113114                        second.to_s + fractional_second.to_s[1..-1] + 'S')
     
    162163              fractional_second =
    163164                ((time_diff - time_diff.to_i)*1000000.0).to_i/1000000.0
    164               return DvDuration.new(date_duration.value + 'T' +
     165              return DvDuration.new(:value =>
     166                        date_duration.value + 'T' +
    165167                        hour.to_s + 'H' +
    166168                        minute.to_s + 'M' +
     
    180182            attr_reader :value
    181183           
    182             def initialize(value, magnitude_status=nil, accuracy=nil,
    183                          accuracy_percent=nil, normal_range=nil,
    184                          normal_status = nil, other_reference_ranges=nil)
    185               self.value = value
     184            def initialize(args = { })
     185              self.value = args[:value]
     186              self.magnitude_status = args[:magnitude_status]
     187              self.normal_range = args[:normal_range]
     188              self.normal_status = args[:normal_status]
     189              self.other_reference_ranges = args[:other_reference_ranges]
    186190            end
    187191
Note: See TracChangeset for help on using the changeset viewer.