Class: DaVinciUSDrugFormularyTestKit::Generator::IGMetadata

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#groupsObject

Returns the value of attribute groups.



4
5
6
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 4

def groups
  @groups
end

#ig_versionObject

Returns the value of attribute ig_version.



4
5
6
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 4

def ig_version
  @ig_version
end

Instance Method Details

#delayed_profilesObject



14
15
16
17
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 14

def delayed_profiles
  @delayed_profiles ||=
    delayed_groups.map(&:profile_url)
end

#ordered_groupsObject



10
11
12
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 10

def ordered_groups
  @ordered_groups ||= groups
end

#postprocess_groups(ig_resources) ⇒ Object



19
20
21
22
23
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 19

def postprocess_groups(ig_resources)
  groups.each do |group|
    group.add_delayed_references(delayed_profiles, ig_resources)
  end
end

#reformatted_versionObject



6
7
8
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 6

def reformatted_version
  @reformatted_version ||= ig_version.delete('.').gsub('-', '_')
end

#to_hashObject



25
26
27
28
29
30
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb', line 25

def to_hash
  {
    ig_version:,
    groups: groups.map(&:to_hash)
  }
end