Sha256: 020190beb11218d9aaa341369ae5cba4539aab5f4d32222ceab0c8cc599d920d

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

# ISO <<Class>> Multiplicity & MultiplicityRange
# writer output in XML
# definition: cardinality (0..1, 0..*, 1..1, 1..*)
# uncertain how this is used for attributes of relational tables since
# ... cardinality is defined between tables, not for attributes.
# ... documentation by NOAA and modelManager suggest best practice for
# ... propertyType is to default to 1.
# ... I assume this is using cardinality like optionality.
# ... therefore ...
# ... lower = 0 => Null
# ... lower = 1 => NotNull
# ... upper not provided a value, but is required to be present

# History:
# 	Stan Smith 2014-12-02 original script

class Multiplicity

	def initialize(xml)
		@xml = xml
	end

	def writeXML(allowNull)

		# xml for iso classes Multiplicity and MultiplicityRange
		@xml.tag!('gco:Multiplicity') do
			@xml.tag!('gco:range') do
				@xml.tag!('gco:MultiplicityRange') do
					@xml.tag!('gco:lower') do
						if !allowNull
							range = 1
						else
							range = 0
						end
						@xml.tag!('gco:Integer',range)
					end
					@xml.tag!('gco:upper')
				end
			end
		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_multiplicity.rb