Class: FHIR::Generator::IGMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/fhir_models/generator/ig_metadata.rb

Constant Summary collapse

ATTRIBUTES =
[
  :name,
  :shortName,
  :version,
  :fhirVersions,
  :url
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ IGMetadata

Returns a new instance of IGMetadata.



14
15
16
17
18
19
20
21
22
# File 'lib/fhir_models/generator/ig_metadata.rb', line 14

def initialize(hash)
  hash.each do |key, value|
    next unless ATTRIBUTES.include?(key.to_sym)

    instance_variable_set(:"@#{key}", value)
  end

  self.shortName = url.split('/').last unless url.nil?
end