Sha256: 4a02b6769e28cd2b21054a5209c62dcad73f189be8c8345f24e9d284bba3d625

Contents?: true

Size: 1.82 KB

Versions: 31

Compression:

Stored size: 1.82 KB

Contents

# unpack series
# Reader - ADIwg JSON to internal data structure

# History:
# 	Stan Smith 2016-10-12 original script

module ADIWG
    module Mdtranslator
        module Readers
            module MdJson

                module Series

                    def self.unpack(hSeries, responseObj)

                        # return nil object if input is empty
                        if hSeries.empty?
                            responseObj[:readerExecutionMessages] << 'Series object is empty'
                            responseObj[:readerExecutionPass] = false
                            return nil
                        end

                        # instance classes needed in script
                        intMetadataClass = InternalMetadata.new
                        intSeries = intMetadataClass.newSeries

                        # series - seriesName
                        if hSeries.has_key?('seriesName')
                            if hSeries['seriesName'] != ''
                                intSeries[:seriesName] = hSeries['seriesName']
                            end
                        end

                        # series - series issue
                        if hSeries.has_key?('seriesIssue')
                            if hSeries['seriesIssue'] != ''
                                intSeries[:seriesIssue] = hSeries['seriesIssue']
                            end
                        end

                        # series - issue page
                        if hSeries.has_key?('issuePage')
                            if hSeries['issuePage'] != ''
                                intSeries[:issuePage] = hSeries['issuePage']
                            end
                        end

                        return intSeries

                    end

                end

            end
        end
    end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.9.2 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.7.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.6.1 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.6.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.5.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.4.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.3.5 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.3.4 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.3.3 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.3.2 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.3.1 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.3.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.2.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.1.2 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.1.1 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.1.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb
adiwg-mdtranslator-2.0.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb