Class: Oscal::V1_2_1::ResultAttestation

Inherits:
Base
  • Object
show all
Defined in:
lib/oscal/v1_2_1/all_models.rb

Instance Method Summary collapse

Methods inherited from Base

lutaml_default_register

Instance Method Details

#json_to_asm_assessment_part_parts(instance, doc) ⇒ Object



7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
# File 'lib/oscal/v1_2_1/all_models.rb', line 7762

def json_to_asm_assessment_part_parts(instance, doc)
  current = instance.instance_variable_get(:@assessment_part)
  if current.is_a?(Array)
    doc["parts"] = current.map { |item| item.respond_to?(:content) ? item.content : item }
  elsif current
    if current.is_a?(Lutaml::Model::Serializable)
      doc["parts"] = Oscal::V1_2_1::AssessmentPart.as_json(current)
    else
      val = current.respond_to?(:content) ? current.content : current
      doc["parts"] = val
    end
  end
end

#json_to_asm_responsible_party_responsible_parties(instance, doc) ⇒ Object



7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
# File 'lib/oscal/v1_2_1/all_models.rb', line 7748

def json_to_asm_responsible_party_responsible_parties(instance, doc)
  current = instance.instance_variable_get(:@responsible_party)
  if current.is_a?(Array)
    doc["responsible-parties"] = current.map { |item| item.respond_to?(:content) ? item.content : item }
  elsif current
    if current.is_a?(Lutaml::Model::Serializable)
      doc["responsible-parties"] = Oscal::V1_2_1::ResponsibleParty.as_json(current)
    else
      val = current.respond_to?(:content) ? current.content : current
      doc["responsible-parties"] = val
    end
  end
end

#validate_occurrencesObject



7776
7777
7778
# File 'lib/oscal/v1_2_1/all_models.rb', line 7776

def validate_occurrences
  Metaschema::ConstraintValidator.validate_occurrences(self, self.class.instance_variable_get(:@occurrence_constraints))
end