Class: IpaTestKit::Generator::SuiteGenerator
- Inherits:
-
Object
- Object
- IpaTestKit::Generator::SuiteGenerator
- Defined in:
- lib/ipa_test_kit/generator/suite_generator.rb
Instance Attribute Summary collapse
-
#base_output_dir ⇒ Object
Returns the value of attribute base_output_dir.
-
#ig_metadata ⇒ Object
Returns the value of attribute ig_metadata.
Class Method Summary collapse
Instance Method Summary collapse
- #base_output_file_name ⇒ Object
- #capability_statement_file_name ⇒ Object
- #capability_statement_group_id ⇒ Object
- #class_name ⇒ Object
- #generate ⇒ Object
- #group_file_list ⇒ Object
- #group_id_list ⇒ Object
- #groups ⇒ Object
- #ig_identifier ⇒ Object
- #ig_link ⇒ Object
-
#initialize(ig_metadata, base_output_dir) ⇒ SuiteGenerator
constructor
A new instance of SuiteGenerator.
- #module_name ⇒ Object
- #output ⇒ Object
- #output_file_name ⇒ Object
- #short_title ⇒ Object
- #smart_launch_file_name ⇒ Object
- #smart_launch_group_id ⇒ Object
- #suite_id ⇒ Object
- #template ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(ig_metadata, base_output_dir) ⇒ SuiteGenerator
Returns a new instance of SuiteGenerator.
15 16 17 18 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 15 def initialize(, base_output_dir) self. = self.base_output_dir = base_output_dir end |
Instance Attribute Details
#base_output_dir ⇒ Object
Returns the value of attribute base_output_dir.
13 14 15 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 13 def base_output_dir @base_output_dir end |
#ig_metadata ⇒ Object
Returns the value of attribute ig_metadata.
13 14 15 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 13 def @ig_metadata end |
Class Method Details
.generate(ig_metadata, base_output_dir) ⇒ Object
8 9 10 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 8 def generate(, base_output_dir) new(, base_output_dir).generate end |
Instance Method Details
#base_output_file_name ⇒ Object
28 29 30 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 28 def base_output_file_name "ipa_test_suite.rb" end |
#capability_statement_file_name ⇒ Object
84 85 86 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 84 def capability_statement_file_name "../../custom_groups/#{.ig_version}/capability_statement_group" end |
#capability_statement_group_id ⇒ Object
88 89 90 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 88 def capability_statement_group_id "ipa_#{.reformatted_version}_capability_statement" end |
#class_name ⇒ Object
32 33 34 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 32 def class_name "IpaTestSuite" end |
#generate ⇒ Object
65 66 67 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 65 def generate File.open(output_file_name, 'w') { |f| f.write(output) } end |
#group_file_list ⇒ Object
79 80 81 82 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 79 def group_file_list @group_file_list ||= groups.map { |group| group.file_name.delete_suffix('.rb') } end |
#group_id_list ⇒ Object
74 75 76 77 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 74 def group_id_list @group_id_list ||= groups.map(&:id) end |
#groups ⇒ Object
69 70 71 72 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 69 def groups .ordered_groups .reject { |group| SpecialCases.exclude_group? group } end |
#ig_identifier ⇒ Object
56 57 58 59 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 56 def ig_identifier version = .ig_version[1..] # Remove leading 'v' "hl7.fhir.uv.ipa##{version}" end |
#ig_link ⇒ Object
61 62 63 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 61 def ig_link 'http://build.fhir.org/ig/HL7/fhir-ipa/' end |
#module_name ⇒ Object
36 37 38 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 36 def module_name "Ipa#{.reformatted_version.upcase}" end |
#output ⇒ Object
24 25 26 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 24 def output @output ||= ERB.new(template).result(binding) end |
#output_file_name ⇒ Object
40 41 42 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 40 def output_file_name File.join(base_output_dir, base_output_file_name) end |
#short_title ⇒ Object
52 53 54 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 52 def short_title "IPA #{.ig_version}" end |
#smart_launch_file_name ⇒ Object
92 93 94 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 92 def smart_launch_file_name "../../custom_groups/#{.ig_version}/ipa_smart_launch_group" end |
#smart_launch_group_id ⇒ Object
96 97 98 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 96 def smart_launch_group_id "ipa_#{.reformatted_version}_smart_launch" end |
#suite_id ⇒ Object
44 45 46 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 44 def suite_id "ipa_#{.reformatted_version}" end |
#template ⇒ Object
20 21 22 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 20 def template @template ||= File.read(File.join(__dir__, 'templates', 'suite.rb.erb')) end |
#title ⇒ Object
48 49 50 |
# File 'lib/ipa_test_kit/generator/suite_generator.rb', line 48 def title "International Patient Access (#{.ig_version})" end |