lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb in adiwg-mdtranslator-1.1.1 vs lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb in adiwg-mdtranslator-1.2.0

- old
+ new

@@ -3,12 +3,13 @@ # History: # Stan Smith 2013-11-01 original script # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers +# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method -require 'code_restriction' +require 'class_codelist' module ADIWG module Mdtranslator module Writers module Iso @@ -20,20 +21,20 @@ end def writeXML(hLegalCons) # classes used - restrictionCode = $IsoNS::MD_RestrictionCode.new(@xml) + codelistClass = $IsoNS::MD_Codelist.new(@xml) @xml.tag!('gmd:MD_LegalConstraints') do # legal constraints - access constraints aAccessCodes = hLegalCons[:accessCodes] if !aAccessCodes.empty? aAccessCodes.each do |code| @xml.tag!('gmd:accessConstraints') do - restrictionCode.writeXML(code) + codelistClass.writeXML('iso_restriction',code) end end elsif $showAllTags @xml.tag!('gmd:accessConstraints') end @@ -41,10 +42,10 @@ # legal constraints - use constraints aUseCodes = hLegalCons[:useCodes] if !aUseCodes.empty? aUseCodes.each do |code| @xml.tag!('gmd:useConstraints') do - restrictionCode.writeXML(code) + codelistClass.writeXML('iso_restriction',code) end end elsif $showAllTags @xml.tag!('gmd:useConstraints') end