Sha256: 3dfc25b6cabe93e73e3b52e19f34b4efcaa1f9813d3f355a470dad33d357c180

Contents?: true

Size: 1.97 KB

Versions: 26

Compression:

Stored size: 1.97 KB

Contents

require ADIWG::Mdtranslator::Readers::SbJson.readerModule('module_citation')

module ADIWG
    module Mdtranslator
        module Readers
            module SbJson

                module AdditionalDocumentation

                    def self.unpack(hAddDoc, responseObj)

                        # return nil object if input is empty
                        intAddDoc = nil
                        return if hAddDoc.empty?

                        # instance classes needed in script
                        intMetadataClass = InternalMetadata.new
                        intAddDoc = intMetadataClass.newAdditionalDocumentation

                        # additional documentation - resource type
                        if hAddDoc.has_key?('resourceType')
                            s = hAddDoc['resourceType']
                            if s != ''
                                intAddDoc[:resourceType] = s
                            end
                        end

                        # additional documentation - resource citation
                        if hAddDoc.has_key?('citation')
                            hCitation = hAddDoc['citation']
                            unless hCitation.empty?
                                intAddDoc[:citation] = Citation.unpack(hCitation, responseObj)
                            else
                                responseObj[:readerExecutionMessages] << 'Additional documentation citation is empty'
                                responseObj[:readerExecutionPass] = false
                                return nil
                            end
                        else
                            responseObj[:readerExecutionMessages] << 'Additional documentation citation is missing'
                            responseObj[:readerExecutionPass] = false
                            return nil
                        end

                        return intAddDoc
                    end

                end

            end
        end
    end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.0.0rc13 lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc11 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc10 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc9 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc8 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc7 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc6 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc5 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc4 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc3 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-2.0.0rc2 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta14 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta13 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta12 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta11 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta10 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta9 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta8 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta7 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb