Sha256: 44fdbc22604d562d28e471f950044fc7f75419962a6b95af0e3b1aadce582471

Contents?: true

Size: 1.3 KB

Versions: 15

Compression:

Stored size: 1.3 KB

Contents

require 'jbuilder'
require_relative 'mdJson_base'
require_relative 'mdJson_attribute'

module ADIWG
  module Mdtranslator
    module Writers
      module MdJson
        module Entity
          extend MdJson::Base

          def self.build(intObj)
            Jbuilder.new do |json|
              json.entityId intObj[:entityId]
              json.commonName intObj[:entityName]
              json.codeName intObj[:entityCode]
              json.alias intObj[:entityAlias]
              json.definition intObj[:entityDefinition]
              json.primaryKeyAttributeCodeName (intObj[:primaryKey])
              json.index(intObj[:indexes]) do |idx|
                json.codeName idx[:indexCode]
                json.allowDuplicates idx[:duplicate]
                json.attributeCodeName (idx[:attributeNames])
              end unless intObj[:indexes].empty?
              json.attribute json_map(intObj[:attributes], Attribute)
              json.foreignKey(intObj[:foreignKeys]) do |fk|
                json.localAttributeCodeName(fk[:fkLocalAttributes])
                json.referencedEntityCodeName fk[:fkReferencedEntity]
                json.referencedAttributeCodeName(fk[:fkReferencedAttributes])
              end unless intObj[:foreignKeys].empty?
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.4.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta14 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta13 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta12 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta11 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta10 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta6 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta5 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta4 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta3 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb
adiwg-mdtranslator-1.4.0.beta1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb