Module: OpenEHR::AssumedLibraryTypes::ISO8601DurationModule

Included in:
ISO8601Duration, RM::DataTypes::Quantity::DateTime::DvDuration
Defined in:
lib/open_ehr/assumed_library_types.rb

Overview

end of ISO8601Timezone

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#daysObject

Returns the value of attribute days.



520
521
522
# File 'lib/open_ehr/assumed_library_types.rb', line 520

def days
  @days
end

#fractional_secondObject

Returns the value of attribute fractional_second.



521
522
523
# File 'lib/open_ehr/assumed_library_types.rb', line 521

def fractional_second
  @fractional_second
end

#hoursObject

Returns the value of attribute hours.



521
522
523
# File 'lib/open_ehr/assumed_library_types.rb', line 521

def hours
  @hours
end

#minutesObject

Returns the value of attribute minutes.



521
522
523
# File 'lib/open_ehr/assumed_library_types.rb', line 521

def minutes
  @minutes
end

#monthsObject

Returns the value of attribute months.



520
521
522
# File 'lib/open_ehr/assumed_library_types.rb', line 520

def months
  @months
end

#secondsObject

Returns the value of attribute seconds.



521
522
523
# File 'lib/open_ehr/assumed_library_types.rb', line 521

def seconds
  @seconds
end

#weeksObject

Returns the value of attribute weeks.



520
521
522
# File 'lib/open_ehr/assumed_library_types.rb', line 520

def weeks
  @weeks
end

#yearsObject

Returns the value of attribute years.



520
521
522
# File 'lib/open_ehr/assumed_library_types.rb', line 520

def years
  @years
end

Instance Method Details

#as_stringObject



579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/open_ehr/assumed_library_types.rb', line 579

def as_string
  str = 'P'
  unless @years.nil?
    str += @years.to_s + 'Y'
  end
  unless @months.nil?
    str += @months.to_s + 'M'
  end
  unless @weeks.nil?
    str += @weeks.to_s + 'W'
  end
  unless @days.nil?
    str += @days.to_s + 'D'
  end
  unless @hours.nil?
    str += 'T' + @hours.to_s + 'H'
    unless @minutes.nil?
      str += @minutes.to_s + 'M'
      unless @seconds.nil?
        str += @seconds.to_s
        unless @fractional_second.nil?
          str += @fractional_second.to_s[1 .. -1]
        end
        str += 'S'
      end
    end
  end
  return str
end