Sha256: 0cfa89900742f8e17ccb387b0c6ad7d64b34b83384f3f69548c7fe1f04177eac

Contents?: true

Size: 1.39 KB

Versions: 11

Compression:

Stored size: 1.39 KB

Contents

# unpack resource formats
# Reader - ADIwg JSON V1 to internal data structure

# History:
# 	Stan Smith 2013-08-26 original script
# 	Stan Smith 2013-11-27 modified to process single resource format rather than array
#   Stan Smith 2014-12-15 refactored to handle namespacing readers and writers

module ADIWG
    module Mdtranslator
        module Readers
            module MdJson

                module ResourceFormat

                    def self.unpack(hResFormat)

                        # instance classes needed in script
                        intMetadataClass = InternalMetadata.new
                        rFormat = intMetadataClass.newResourceFormat

                        # format - name
                        if hResFormat.has_key?('formatName')
                            s = hResFormat['formatName']
                            if s != ''
                                rFormat[:formatName] = s
                            end
                        end

                        # format - version
                        if hResFormat.has_key?('version')
                            s = hResFormat['version']
                            if s != ''
                                rFormat[:formatVersion] = s
                            end
                        end

                        return rFormat
                    end

                end

            end
        end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.2.1 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.0.0 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.0.0rc4 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.0.0rc3 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.0.0rc2 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-1.0.0rc1 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceFormat.rb
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb