Class: Oscal::V1_2_1::ByComponentInherited
- Defined in:
- lib/oscal/v1_2_1/all_models.rb
Instance Method Summary collapse
- #json_to_asm_link_links(instance, doc) ⇒ Object
- #json_to_asm_property_props(instance, doc) ⇒ Object
- #json_to_asm_responsible_role_responsible_roles(instance, doc) ⇒ Object
Methods inherited from Base
Instance Method Details
#json_to_asm_link_links(instance, doc) ⇒ Object
4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 |
# File 'lib/oscal/v1_2_1/all_models.rb', line 4219 def json_to_asm_link_links(instance, doc) current = instance.instance_variable_get(:@link) if current.is_a?(Array) doc["links"] = current.map { |item| item.respond_to?(:content) ? item.content : item } elsif current if current.is_a?(Lutaml::Model::Serializable) doc["links"] = Oscal::V1_2_1::Link.as_json(current) else val = current.respond_to?(:content) ? current.content : current doc["links"] = val end end end |
#json_to_asm_property_props(instance, doc) ⇒ Object
4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 |
# File 'lib/oscal/v1_2_1/all_models.rb', line 4205 def json_to_asm_property_props(instance, doc) current = instance.instance_variable_get(:@property) if current.is_a?(Array) doc["props"] = current.map { |item| item.respond_to?(:content) ? item.content : item } elsif current if current.is_a?(Lutaml::Model::Serializable) doc["props"] = Oscal::V1_2_1::Property.as_json(current) else val = current.respond_to?(:content) ? current.content : current doc["props"] = val end end end |
#json_to_asm_responsible_role_responsible_roles(instance, doc) ⇒ Object
4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 |
# File 'lib/oscal/v1_2_1/all_models.rb', line 4191 def json_to_asm_responsible_role_responsible_roles(instance, doc) current = instance.instance_variable_get(:@responsible_role) if current.is_a?(Array) doc["responsible-roles"] = current.map { |item| item.respond_to?(:content) ? item.content : item } elsif current if current.is_a?(Lutaml::Model::Serializable) doc["responsible-roles"] = Oscal::V1_2_1::ResponsibleRole.as_json(current) else val = current.respond_to?(:content) ? current.content : current doc["responsible-roles"] = val end end end |