Sha256: 6731d76c1eaee8590e37aac836f2ce6de4bce8aaefe6e86f1f45f3f361708835

Contents?: true

Size: 1.68 KB

Versions: 47

Compression:

Stored size: 1.68 KB

Contents

# mdJson 2.0 writer - entity

# History:
#  Stan Smith 2017-11-01 add new elements to support fgdc
#  Stan Smith 2017-03-19 original script

require 'jbuilder'
require_relative 'mdJson_citation'
require_relative 'mdJson_entityAttribute'
require_relative 'mdJson_entityIndex'
require_relative 'mdJson_entityForeignKey'

module ADIWG
   module Mdtranslator
      module Writers
         module MdJson

            module Entity

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

               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 # build
            end # Entity

         end
      end
   end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.19.0.pre.beta.31 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb