Sha256: 058d96edaeb2c0fc42f59011f36b18bcd1c666066e0218fa02697d820de977fb

Contents?: true

Size: 1.62 KB

Versions: 7

Compression:

Stored size: 1.62 KB

Contents

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

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

require 'module_dateTimeFun'

class MD_StandardOrderProcess

	def initialize(xml)
		@xml = xml
	end

	def writeXML(orderProcess)

		# classes used

		@xml.tag!('gmd:MD_StandardOrderProcess') do

			# order process - fees
			s = orderProcess[:fees]
			if !s.nil?
				@xml.tag!('gmd:fees') do
					@xml.tag!('gco:CharacterString',s)
				end
			elsif $showAllTags
				@xml.tag!('gmd:fees')
			end

			# order process - plannedAvailableDateTime
			hDateTime = orderProcess[:plannedDateTime]
			if !hDateTime.empty?
				paDateTime = hDateTime[:dateTime]
				paDateRes = hDateTime[:dateResolution]
				if paDateTime.nil?
					@xml.tag!('gmd:plannedAvailableDateTime')
				else
					@xml.tag!('gmd:plannedAvailableDateTime') do
						dateTimeStr =
							AdiwgDateTimeFun.stringDateTimeFromDateTime(paDateTime,paDateRes)
						@xml.tag!('gco:DateTime',dateTimeStr)
					end
				end
			elsif $showAllTags
				@xml.tag!('gmd:plannedAvailableDateTime')
			end

			# order process - orderingInstructions
			s = orderProcess[:orderInstructions]
			if !s.nil?
				@xml.tag!('gmd:orderingInstructions') do
					@xml.tag!('gco:CharacterString',s)
				end
			elsif $showAllTags
				@xml.tag!('gmd:orderingInstructions')
			end

			# order process - turnaround
			s = orderProcess[:turnaround]
			if !s.nil?
				@xml.tag!('gmd:turnaround') do
					@xml.tag!('gco:CharacterString',s)
				end
			elsif $showAllTags
				@xml.tag!('gmd:turnaround')
			end

		end

	end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/writers/iso/classes/class_standardOrderProcess.rb
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb