Module: ADIWG::Mdtranslator::Writers::MdJson::Contact

Defined in:
lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb

Class Method Summary collapse

Class Method Details

.build(hContact) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb', line 22

def self.build(hContact)

   Jbuilder.new do |json|
      json.contactId hContact[:contactId]
      json.isOrganization hContact[:isOrganization]
      json.name hContact[:name]
      json.externalIdentifier hContact[:externalIdentifier] unless hContact[:externalIdentifier].empty?
      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