Sha256: f93af61c14c7e4dd76e7d8b463122c0110b98a465008248ccd013555a21c55ed

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

# ISO <<Class>> TimePeriod
# writer output in XML

# History:
# 	Stan Smith 2013-11-04 original script
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure

require 'module_dateTimeFun'

class TimePeriod

	def initialize(xml)
		@xml = xml
	end

	def writeXML(hTempP)

		timeID = hTempP[:timeId]
		if timeID.nil?
			$idCount = $idCount.succ
			timeID = 'timePeriod' + $idCount
		end

		@xml.tag!('gml:TimePeriod',{'gml:id'=>timeID}) do

			# time period - description
			s = hTempP[:description]
			if !s.nil?
				@xml.tag!('gml:description',s)
			elsif $showAllTags
				@xml.tag!('gml:description')
			end

			# time period - begin position
			hDateTime = hTempP[:beginTime]
			timeInstant = hDateTime[:dateTime]
			timeResolution = hDateTime[:dateResolution]
			dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(timeInstant,timeResolution)
			@xml.tag!('gml:beginPosition',dateStr)

			# time period - begin position
			hDateTime = hTempP[:endTime]
			timeInstant = hDateTime[:dateTime]
			timeResolution = hDateTime[:dateResolution]
			dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(timeInstant,timeResolution)
			@xml.tag!('gml:endPosition',dateStr)

		end

	end

end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/writers/iso/classes/class_timePeriod.rb