Module: ADIWG::Mdtranslator::Readers::SbJson::Rights

Defined in:
lib/adiwg/mdtranslator/readers/sbJson/modules/module_rights.rb

Class Method Summary collapse

Class Method Details

.unpack(hSbJson, hResponseObj) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/adiwg/mdtranslator/readers/sbJson/modules/module_rights.rb', line 16

def self.unpack(hSbJson, hResponseObj)

   # instance classes needed in script
   intMetadataClass = InternalMetadata.new

   hConstraint = intMetadataClass.newConstraint
   hLegal = intMetadataClass.newLegalConstraint

   if hSbJson.has_key?('rights')
      sbRights = hSbJson['rights']
      unless sbRights.nil? || sbRights == ''
         hConstraint[:type] = 'legal'
         hLegal[:otherCons][0] = sbRights
         hConstraint[:legalConstraint] = hLegal
         return hConstraint
      end
   end

   return nil

end