Sha256: 25431d035eac84a3456cb34f2937f6f677b5515b99fc2483565fd51cd08fb71d

Contents?: true

Size: 1.69 KB

Versions: 44

Compression:

Stored size: 1.69 KB

Contents

# mdJson 2.0 writer - contact

# History:
#   Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0
#   Josh Bradley original script

require 'jbuilder'
require_relative 'mdJson_graphicOverview'
require_relative 'mdJson_phone'
require_relative 'mdJson_address'
require_relative 'mdJson_onlineResource'

module ADIWG
   module Mdtranslator
      module Writers
         module MdJson

            module Contact

               @Namespace = ADIWG::Mdtranslator::Writers::MdJson

               def self.build(hContact)

                  Jbuilder.new do |json|
                     json.contactId hContact[:contactId]
                     json.isOrganization hContact[:isOrganization]
                     json.name hContact[:name]
                     json.positionName hContact[:positionName]
                     json.memberOfOrganization hContact[:memberOfOrgs] unless hContact[:memberOfOrgs].empty?
                     json.logoGraphic @Namespace.json_map(hContact[:logos], GraphicOverview)
                     json.phone @Namespace.json_map(hContact[:phones], Phone)
                     json.address @Namespace.json_map(hContact[:addresses], Address)
                     json.electronicMailAddress hContact[:eMailList] unless hContact[:eMailList].empty?
                     json.onlineResource @Namespace.json_map(hContact[:onlineResources], OnlineResource)
                     json.hoursOfService hContact[:hoursOfService] unless hContact[:hoursOfService].empty?
                     json.contactInstructions hContact[:contactInstructions]
                     json.contactType hContact[:contactType]
                  end

               end # build
            end # Contact

         end
      end
   end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.17.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.16.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.15.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.14.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.14.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.14.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.13.3 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.13.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.13.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.13.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.12.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.12.0.pre lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.10.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.9.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.7.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.6.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb
adiwg-mdtranslator-2.6.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb