lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb in adiwg-mdtranslator-1.4.0 vs lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb in adiwg-mdtranslator-2.0.0rc2

- old
+ new

@@ -1,18 +1,34 @@ +# mdJson 2.0 writer - responsible party + +# History: +# Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 +# Josh Bradley original script + require 'jbuilder' +require_relative 'mdJson_extent' +require_relative 'mdJson_party' module ADIWG - module Mdtranslator - module Writers - module MdJson - module ResponsibleParty - def self.build(intObj) - Jbuilder.new do |json| - json.contactId intObj[:contactId] - json.role intObj[:roleName] || MdJson.getContact(intObj[:contactId])[:primaryRole] - end - end - end + module Mdtranslator + module Writers + module MdJson + + module ResponsibleParty + + @Namespace = ADIWG::Mdtranslator::Writers::MdJson + + def self.build(hResParty) + + Jbuilder.new do |json| + json.role hResParty[:roleName] + json.roleExtent @Namespace.json_map(hResParty[:roleExtents], Extent) + json.party @Namespace.json_map(hResParty[:parties], Party) + end + + end # build + end # ResponsibleParty + + end end - end - end + end end