Class: Oscal::Resource

Inherits:
BaseClass show all
Defined in:
lib/oscal/resource.rb

Constant Summary collapse

KEY =
%i(uuid title description props docuement_ids citation rlinks
base64 remarks)

Instance Method Summary collapse

Methods inherited from BaseClass

#initialize, wrap

Methods included from Serializer

included, #to_h, #to_json, #to_xml, #to_yaml

Constructor Details

This class inherits a constructor from Oscal::BaseClass

Instance Method Details

#set_value(key_name, val) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/oscal/resource.rb', line 12

def set_value(key_name, val)
  case key_name
  when "props"
    Property.wrap(val)
  when "document_ids"
    DocumentId.wrap(val)
  when "citation"
    Citation.wrap(val)
  when "rlinks"
    Rlink.wrap(val)
  when "base64"
    Base64Object.wrap(val)
  else
    val
  end
end