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-1.4.0.beta6 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta5 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta4 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta3 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta2 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
adiwg-mdtranslator-1.4.0.beta1 lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb