Module: Adiwg_BrowseGraphic

Defined in:
lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_browseGraphic.rb

Overview

History: Stan Smith 2013-10-17 original script Stan Smith 2013-11-27 modified to process single browse graphic rather than array

Stan Smith 2014-04-28 modified attribute names to match json schema 0.3.0

Class Method Summary collapse

Class Method Details

.unpack(hBgraphic) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_browseGraphic.rb', line 11

def self.unpack(hBgraphic)

	# instance classes needed in script
	intMetadataClass = InternalMetadata.new
	intBGraphic = intMetadataClass.newBrowseGraphic

	# graphic - file name
	if hBgraphic.has_key?('fileName')
		s = hBgraphic['fileName']
		if s != ''
			intBGraphic[:bGName] = s
		end
	end

	# graphic - file description
	if hBgraphic.has_key?('fileDescription')
		s = hBgraphic['fileDescription']
		if s != ''
			intBGraphic[:bGDescription] = s
		end
	end

	# graphic - file  type
	if hBgraphic.has_key?('fileType')
		s = hBgraphic['fileType']
		if s != ''
			intBGraphic[:bGType] = s
		end
	end

	# graphic - web link
	if hBgraphic.has_key?('fileUri')
		s = hBgraphic['fileUri']
		if s != ''
			intBGraphic[:bGURI] = s
		end
	end

	return intBGraphic
end