Module: ADIWG::Mdtranslator::Writers::MdJson::Entity

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

Class Method Summary collapse

Class Method Details

.build(hEntity) ⇒ Object



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

def self.build(hEntity)

   Jbuilder.new do |json|
      json.entityId hEntity[:entityId]
      json.commonName hEntity[:entityName]
      json.codeName hEntity[:entityCode]
      json.alias hEntity[:entityAlias] unless hEntity[:entityAlias].empty?
      json.definition hEntity[:entityDefinition]
      json.entityReference @Namespace.json_map(hEntity[:entityReferences], Citation)
      json.primaryKeyAttributeCodeName hEntity[:primaryKey] unless hEntity[:primaryKey].empty?
      json.index @Namespace.json_map(hEntity[:indexes], EntityIndex)
      json.attribute @Namespace.json_map(hEntity[:attributes], EntityAttribute)
      json.foreignKey @Namespace.json_map(hEntity[:foreignKeys], EntityForeignKey)
      json.fieldSeparatorCharacter hEntity[:fieldSeparatorCharacter]
      json.numberOfHeaderLines hEntity[:numberOfHeaderLines]
      json.quoteCharacter hEntity[:quoteCharacter]
   end

end