Class: FHIR::ExampleScenarioActor
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::ExampleScenarioActor
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/example_scenario_actor.rb
Overview
fhir/example_scenario_actor.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = ExampleScenarioActor.new) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'app/models/fhir/example_scenario_actor.rb', line 40 def self.transform_json(json_hash, target = ExampleScenarioActor.new) result = self.superclass.transform_json(json_hash, target) result['actorId'] = PrimitiveString.transform_json(json_hash['actorId'], json_hash['_actorId']) unless json_hash['actorId'].nil? result['type'] = ExampleScenarioActorType.transform_json(json_hash['type'], json_hash['_type']) unless json_hash['type'].nil? result['name'] = PrimitiveString.transform_json(json_hash['name'], json_hash['_name']) unless json_hash['name'].nil? result['description'] = PrimitiveMarkdown.transform_json(json_hash['description'], json_hash['_description']) unless json_hash['description'].nil? result end |
Instance Method Details
#as_json(*args) ⇒ Object
10 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 |
# File 'app/models/fhir/example_scenario_actor.rb', line 10 def as_json(*args) result = super unless self.actorId.nil? result['actorId'] = self.actorId.value serialized = Extension.serializePrimitiveExtension(self.actorId) result['_actorId'] = serialized unless serialized.nil? end unless self.type.nil? result['type'] = self.type.value serialized = Extension.serializePrimitiveExtension(self.type) result['_type'] = serialized unless serialized.nil? end unless self.name.nil? result['name'] = self.name.value serialized = Extension.serializePrimitiveExtension(self.name) result['_name'] = serialized unless serialized.nil? end unless self.description.nil? result['description'] = self.description.value serialized = Extension.serializePrimitiveExtension(self.description) result['_description'] = serialized unless serialized.nil? end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |